├── FriendCircles ├── output │ ├── output00.txt │ ├── output01.txt │ ├── output02.txt │ ├── output03.txt │ ├── output04.txt │ ├── output05.txt │ ├── output06.txt │ ├── output07.txt │ ├── output08.txt │ └── output09.txt ├── input │ ├── input00.txt │ ├── input01.txt │ ├── input02.txt │ ├── input03.txt │ ├── input04.txt │ ├── input05.txt │ └── input06.txt ├── __pycache__ │ ├── circles.cpython-34.pyc │ └── friends.cpython-34.pyc ├── js_solution │ ├── dfs.html │ ├── friends.js │ └── friends_vis.js ├── efficient_friends.py └── friends.py ├── MinimumStrongNetwork ├── .cache │ └── v │ │ └── cache │ │ └── lastfailed ├── __pycache__ │ ├── test_.cpython-34-PYTEST.pyc │ └── MinSmallNetwork.cpython-34.pyc ├── js_solution │ ├── min_max_vis.css │ ├── max_min_network.html │ ├── min_max_generator.js │ ├── min_max_vis.js │ ├── min_max_vis_delayededges.js │ └── min_max_vis_nonforce.js ├── test_.py └── MinSmallNetwork.py ├── Adjectives ├── README.md ├── Combinations.py ├── MonteCarlo.py └── BruteForce.py ├── HelperFunctions └── HackerRank.py ├── D3Zoom ├── D3Zoom_fixed_min.js ├── zoom_fixed.html ├── zoom.html ├── zoom_fixed_min.html ├── D3Zoom_fixed.js └── D3Zoom.js ├── .gitattributes ├── clippath ├── clippath_groups.html ├── clippath.js ├── unclipped.js └── clippath_groups.js └── .gitignore /FriendCircles/output/output00.txt: -------------------------------------------------------------------------------- 1 | 2 -------------------------------------------------------------------------------- /FriendCircles/output/output01.txt: -------------------------------------------------------------------------------- 1 | 5 -------------------------------------------------------------------------------- /FriendCircles/output/output02.txt: -------------------------------------------------------------------------------- 1 | 6 -------------------------------------------------------------------------------- /FriendCircles/output/output03.txt: -------------------------------------------------------------------------------- 1 | 70 -------------------------------------------------------------------------------- /FriendCircles/output/output04.txt: -------------------------------------------------------------------------------- 1 | 180 -------------------------------------------------------------------------------- /FriendCircles/output/output05.txt: -------------------------------------------------------------------------------- 1 | 1 -------------------------------------------------------------------------------- /FriendCircles/output/output06.txt: -------------------------------------------------------------------------------- 1 | 300 -------------------------------------------------------------------------------- /FriendCircles/output/output07.txt: -------------------------------------------------------------------------------- 1 | 200 -------------------------------------------------------------------------------- /FriendCircles/output/output08.txt: -------------------------------------------------------------------------------- 1 | 1 -------------------------------------------------------------------------------- /FriendCircles/output/output09.txt: -------------------------------------------------------------------------------- 1 | 290 -------------------------------------------------------------------------------- /MinimumStrongNetwork/.cache/v/cache/lastfailed: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /FriendCircles/input/input00.txt: -------------------------------------------------------------------------------- 1 | 4 2 | YYNN 3 | YYYN 4 | NYYN 5 | NNNY -------------------------------------------------------------------------------- /FriendCircles/input/input01.txt: -------------------------------------------------------------------------------- 1 | 5 2 | YNNNN 3 | NYNNN 4 | NNYNN 5 | NNNYN 6 | NNNNY -------------------------------------------------------------------------------- /Adjectives/README.md: -------------------------------------------------------------------------------- 1 | #Problem Statement 2 | http://canyon289.github.io/pickingadjectives.html -------------------------------------------------------------------------------- /FriendCircles/__pycache__/circles.cpython-34.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/canyon289/DataScienceInterview/master/FriendCircles/__pycache__/circles.cpython-34.pyc -------------------------------------------------------------------------------- /FriendCircles/__pycache__/friends.cpython-34.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/canyon289/DataScienceInterview/master/FriendCircles/__pycache__/friends.cpython-34.pyc -------------------------------------------------------------------------------- /MinimumStrongNetwork/__pycache__/test_.cpython-34-PYTEST.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/canyon289/DataScienceInterview/master/MinimumStrongNetwork/__pycache__/test_.cpython-34-PYTEST.pyc -------------------------------------------------------------------------------- /FriendCircles/input/input02.txt: -------------------------------------------------------------------------------- 1 | 10 2 | YNNNNNYNNN 3 | NYNNNYNNNY 4 | NNYNYNNNNN 5 | NNNYNNNNNN 6 | NNYNYNNNNN 7 | NYNNNYNNNN 8 | YNNNNNYNNN 9 | NNNNNNNYNN 10 | NNNNNNNNYN 11 | NYNNNNNNNY -------------------------------------------------------------------------------- /MinimumStrongNetwork/__pycache__/MinSmallNetwork.cpython-34.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/canyon289/DataScienceInterview/master/MinimumStrongNetwork/__pycache__/MinSmallNetwork.cpython-34.pyc -------------------------------------------------------------------------------- /HelperFunctions/HackerRank.py: -------------------------------------------------------------------------------- 1 | ''' 2 | Helper functions for HackerRank tests 3 | ''' 4 | def input_list(): 5 | n_lines = int(input()) 6 | input_list = [input() for n in range(n_lines)] 7 | 8 | return input_list -------------------------------------------------------------------------------- /MinimumStrongNetwork/js_solution/min_max_vis.css: -------------------------------------------------------------------------------- 1 | /* Style sheet for Min Max network visualization */ 2 | .edge { 3 | stroke: #aaa; 4 | } 5 | 6 | .text { 7 | stroke:#333; 8 | cursor:pointer; 9 | } 10 | 11 | .node{ 12 | stroke: black; 13 | stroke-width:2px; 14 | fill:white; 15 | opacity:1; 16 | } -------------------------------------------------------------------------------- /Adjectives/Combinations.py: -------------------------------------------------------------------------------- 1 | from itertools import combinations 2 | 3 | def cl(n,k): 4 | ''' 5 | k combination of out length n set 6 | ''' 7 | return len(list(combinations(range(n),k))) 8 | 9 | numerator = cl(5,4) * cl(19,1) + cl(5,5)*cl(19,0) 10 | denominator = cl(24, 5) 11 | 12 | numerator/denominator -------------------------------------------------------------------------------- /D3Zoom/D3Zoom_fixed_min.js: -------------------------------------------------------------------------------- 1 | var zoom 2 | var svg 3 | var initial_transform 4 | 5 | zoom = d3.zoom() 6 | initial_transform = d3.zoomIdentity.translate(50,50) 7 | 8 | svg = d3.select("body").append("svg") 9 | 10 | //Adjust SVG Transform 11 | svg.call(zoom.transform, initial_transform) 12 | 13 | 14 | console.log(d3.zoomTransform(svg)) 15 | console.log(d3.zoomTransform(svg.node())) 16 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | 4 | # Custom for Visual Studio 5 | *.cs diff=csharp 6 | 7 | # Standard to msysgit 8 | *.doc diff=astextplain 9 | *.DOC diff=astextplain 10 | *.docx diff=astextplain 11 | *.DOCX diff=astextplain 12 | *.dot diff=astextplain 13 | *.DOT diff=astextplain 14 | *.pdf diff=astextplain 15 | *.PDF diff=astextplain 16 | *.rtf diff=astextplain 17 | *.RTF diff=astextplain 18 | -------------------------------------------------------------------------------- /Adjectives/MonteCarlo.py: -------------------------------------------------------------------------------- 1 | #Python Simulation for problem 2 | import numpy as np 3 | import pandas as pd 4 | 5 | s = pd.Series(list(range(24))) 6 | number_of_trials, matches = (0,0) 7 | 8 | while number_of_trials < 1000000: 9 | c1 = s[np.random.choice(24,5, replace = False)] 10 | c2 = s[np.random.choice(24,5, replace = False)] 11 | if c2.isin(c1).sum() >= 4: 12 | matches +=1 13 | 14 | number_of_trials +=1 15 | print(matches/number_of_trials) -------------------------------------------------------------------------------- /D3Zoom/zoom_fixed.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 23 |
24 |