├── Programming ├── CPP │ ├── Dynamic Programming │ │ └── Stock_Maximize.cpp │ ├── Graph Theory │ │ └── BFS_Short_Reach.cpp │ └── Miscellenous │ │ └── staircase.cpp ├── Python │ └── Miscellaneous │ │ └── Absolute_Permutation.py └── Robots.txt ├── README.md └── Web-Development ├── Mum with cub ├── index.html ├── readme.md └── style.css └── Robots.txt /Programming/CPP/Dynamic Programming/Stock_Maximize.cpp: -------------------------------------------------------------------------------- 1 | // PROBLEM NAME: Stock Maximize (Dynamic Programming) at HackerRank Copyright. 2 | // SUBMITTED BY: Jishan Shaikh 3 | // LEVEL: Experienced in C++ 4 | // ========================= 5 | // What to learn? 6 | // The Essense of Dynamic Programming i.e. How dynamic programming works? 7 | // ====================================================================== 8 | 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | 18 | using namespace std; 19 | 20 | int num[11111111]; 21 | int main(){ 22 | int t; 23 | cin >> t; 24 | for(int cas=1; cas<=t; cas++){ 25 | vector> a; 26 | a.clear(); 27 | int n; 28 | cin >> n; 29 | for(int i=0; i> num[i]; 31 | a.push_back(make_pair(num[i], i)); 32 | } 33 | sort(a.begin(), a.end()); 34 | int start=0; 35 | long long res=0; 36 | for(int i=a.size()-1; i>=0; i--){ 37 | if(a[i].second>=start){ 38 | for(; start<=a[i].second; start++){ 39 | res -= num[start]; 40 | res += a[i].first; 41 | } 42 | } 43 | } 44 | cout << res << endl; 45 | } 46 | return 0; 47 | } 48 | -------------------------------------------------------------------------------- /Programming/CPP/Graph Theory/BFS_Short_Reach.cpp: -------------------------------------------------------------------------------- 1 | // PROBLEM NAME: Breadth First Search: Shortest Reach (Graph Theory) at HackerRank Copyright. 2 | // SUBMITTED BY: Jishan Shaikh 3 | // LEVEL: Experienced in C++ 4 | // ========================= 5 | // What to learn? 6 | // Implementation of Breadth first search in adjacency matrix representation 7 | // ========================================================================= 8 | 9 | #include 10 | 11 | using namespace std; 12 | 13 | vector edge[1999]; 14 | 15 | int main(){ 16 | int t, n, m, x, y, s, i; 17 | cin >> t; 18 | while(t--){ 19 | cin >> n >> m; 20 | for(i=0; i> x >> y; 24 | edge[x].push_back(y); 25 | edge[y].push_back(x); 26 | } 27 | cin >> s; 28 | 29 | bool vis[n+1]; 30 | memset(vis, false, sizeof(vis)); // Initialising all values of vis to false i.e. not visited 31 | 32 | int dist[n+1]; 33 | memset(dist, 0, sizeof(dist)); // Initialising all values of dist to 0; 34 | 35 | list q; 36 | q.push_back(s); 37 | vis[s]=true; 38 | dist[s]=0; 39 | while(!q.empty()){ 40 | int u=q.front(); 41 | q.pop_front(); 42 | for(i=0; i 5 | 6 | using namespace std; 7 | 8 | void staircase(int n){ 9 | n--; 10 | int i=n-1, j=0; 11 | while(i<=n && j<=n && i+j==n-1){ 12 | for(int temp=i; temp>=0; temp--){ 13 | cout << " "; 14 | } 15 | for(int temp=j; temp>=0; temp--){ 16 | cout << "#"; 17 | } 18 | cout << endl; 19 | i--; 20 | j++; 21 | } 22 | } 23 | 24 | int main(){ 25 | int n; 26 | cin >> n; 27 | staircase(n); 28 | return 0; 29 | } 30 | -------------------------------------------------------------------------------- /Programming/Python/Miscellaneous/Absolute_Permutation.py: -------------------------------------------------------------------------------- 1 | // PROBLEM NAME: Absolute Permutation (Implementation) at HackerRank Copyright. 2 | // SUBMITTED BY: Jishan Shaikh 3 | // LEVEL: Intermediate in Python 4 | // ============================= 5 | // What to learn? 6 | // map() and its features to problem solving. 7 | // ========================================== 8 | 9 | t = int(raw_input()) 10 | ans = [] 11 | 12 | for _ in xrange(t): 13 | n,k = map(int,raw_input().split()) 14 | ans = [0 for _ in xrange(n)] 15 | for i in xrange(1,n+1): 16 | if i-k >0 and ans[i-k-1]==0: 17 | ans[i-k-1] = i 18 | elif i+k <= n and ans[i+k-1] == 0: 19 | ans[i+k-1] = i 20 | else: 21 | break 22 | if 0 in ans: 23 | print -1 24 | else: 25 | print " ".join(map(str,ans)) 26 | -------------------------------------------------------------------------------- /Programming/Robots.txt: -------------------------------------------------------------------------------- 1 | lorem ipsom idor. 2 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # :coffee: Explore-the-codes 2 | > A collection of computer programs to learn, explore, and evaluate. Understand the problem, give a big punch to it, think more of it, tired. Now look up here. Run it? Like it? go home with a little new knowledge. Your helping hand to competitve programming (Beware of Plagiarism!). Nail the technical interviews with confidence. 3 | 4 | ## Topics 5 | - [Programming](https://www.github.com/programming) 6 | - [C Programming](https://www.github.com/) 7 | - [C++ Programming](https://github.com/Jishanshaikh4/Explore-the-codes/tree/master/Programming/CPP): Number of Programs till now **2** 8 | - [Java Programming](https://www.github.com/) 9 | - [Python Programming](https://github.com/Jishanshaikh4/Explore-the-codes/tree/master/Programming/Python): Number of Programs till now **1** 10 | - [JavaScript Programming](https://www.github.com/) 11 | - [PHP Programming](https://www.github.com/) 12 | - [Matlab Programming](https://www.github.com/) 13 | - [More](https://www.github.com/) 14 | - [Web Developement](https://www.github.com/) 15 | - [HTML](https://www.github.com/) 16 | - [CSS](https://www.github.com/) 17 | - [JS](https://www.github.com/) 18 | - [Bootstrap](https://www.github.com/) 19 | - [More](https://www.github.com/) 20 | - Others 21 | - [LaTex](https://www.github.com/) 22 | - [Competitive Programming]((https://www.github.com/)) 23 | - [Coding. Why to do it?](https://www.github.com/) 24 | - [Nail the Tech Interview.](https://www.github.com/) 25 | - [More](https://www.github.com/) 26 | 27 | ## More Information 28 | 29 | ### What is it and How can you use it? 30 | Take a look at any of the code. You are encouraging to first read and understand the code (If you can) and then try to guess output when that code run. Now run the code and find what's the difference. Understand implementational details along with syntactical information of language. Do whatever you want to do with these. Good? Right. Suggestions? Leave a pull request. 31 | 32 | ### Wanna Contribute? 33 | Feel free to contribute. Any pretty suggestion will be acknowledged. 34 | 35 | ### Licence 36 | Just feel free to examine and test these codes. They are set in Public Domain! 37 | 38 | [![CC0](https://i.creativecommons.org/p/zero/1.0/88x31.png)](https://creativecommons.org/publicdomain/zero/1.0/) 39 | -------------------------------------------------------------------------------- /Web-Development/Mum with cub/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Mum with cub 5 | 6 | 7 | 8 | 9 | 12 | 15 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /Web-Development/Mum with cub/readme.md: -------------------------------------------------------------------------------- 1 | # Mum with cub 2 | 3 | ## Important 4 | - Forked from [Codepen.io](https://codepen.io/ainalem/pen/vagXBL). 5 | - Licensed as per Codepen.io and [Mikael Ainalem](https://codepen.io/ainalem). 6 | - Thanks [Mikael Ainalem](https://codepen.io/ainalem) for a brilliant idea. 7 | -------------------------------------------------------------------------------- /Web-Development/Mum with cub/style.css: -------------------------------------------------------------------------------- 1 | body { 2 | margin: 0; 3 | } 4 | svg { 5 | background: black; 6 | filter: invert(100%); 7 | height: 100vmin; 8 | left: calc(50% - 50vmin); 9 | position: absolute; 10 | width: 100vmin; 11 | } 12 | .cub { 13 | animation: Cycle 5s infinite; 14 | fill:#fff; 15 | mix-blend-mode:difference; 16 | stroke-linecap:butt; 17 | stroke-linejoin:miter; 18 | stroke-opacity:1; 19 | stroke-width:1px; 20 | stroke:none; 21 | } 22 | @keyframes Cycle { 23 | 0% { transform: translateX(70%); } 24 | 5% { transform: translateX(70%); } 25 | 25% { transform: translateX(0%); } 26 | 75% { transform: translateX(0%); } 27 | 95% { transform: translateX(-85%); } 28 | 100% { transform: translateX(-85%); } 29 | } 30 | -------------------------------------------------------------------------------- /Web-Development/Robots.txt: -------------------------------------------------------------------------------- 1 | Lorem Ipsum idor. 2 | --------------------------------------------------------------------------------