This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git lfs install # if git config is not currently configured for LFS | |
git lfs track "*.jpg" "*.png" # track all jpg and png files (recursively) | |
git add .gitattributes **/*.jpg **/*.png # add .gitattributes and LFS artifacts (recursively) | |
git lfs ls-files # optional: ensure your LFS files are tracked before committing | |
git commit -m "Tracking and adding LFS artifacts" | |
git push |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const deeplyNestedObject = { | |
name: "John Doe", | |
age: 30, | |
address: { | |
street: "123 Main St", | |
city: "Somewhere", | |
postalCode: "12345", | |
coordinates: { | |
latitude: 37.7749, | |
longitude: -122.4194, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Paste the methods below in Chrome Console (Ctrl + Shift + I), and then convert the data into JSON string using: | |
JSON.stringify(data); | |
Paste that string as a parameter to `prefillSubjectsAndGrades` method. | |
Example is given at the end of this file. | |
NOTE: If the fields change (their `id` values in particular), then the algorithm will break, and is rendered useless. | |
*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
static int front = 0; | |
static int rear = 0; | |
static int capacity = 2; | |
static int* q; | |
void enq(int element) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Problem Link: https://i.ibb.co/hVT71cp/Container-with-most-water.png | |
// Test Link: https://ide.geeksforgeeks.org/OBtxHYttjP | |
// Solution Status: Could not find this particular problem anywhere on any online judge | |
#include <stack> | |
#include <vector> | |
#include <climits> | |
#include <iostream> | |
#include <algorithm> | |
using namespace std; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Problem Link: https://leetcode.com/problems/3sum-closest/ | |
// Test Link: https://ide.geeksforgeeks.org/EBNEOuStvx | |
// Solution Status: Accepted in Leetcode Online Judge | |
class Solution { | |
public: | |
// Approach: Two-Pointer Technique. Time Complexity: Quadratic O(N^2) -- because we fix one element, and for | |
// the remaining elements, we apply two-ptr technique. | |
int threeSumClosest(vector<int>& nums, int target) { | |
sort(nums.begin(), nums.end()); // sort the array to apply two-ptr technique |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Problem Link: https://practice.geeksforgeeks.org/problems/detect-cycle-in-an-undirected-graph/1/ | |
// Solution Status: Accepted by GFG Judge | |
/** | |
* GYTWrkz Solutions Interview Question | |
* ------------------------------------ | |
* Question 1: Given an Undirected Graph, find whether the Graph has a Cycle or Not (Discussed the approach with the interviewer). | |
*/ | |
#include <iostream> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Forest Definition: Disjoint Union of Acyclic Graphs (or Trees) | |
#include <vector> | |
#include <iostream> | |
#include <algorithm> | |
using namespace std; | |
bool DFSRec(vector<int> *G, vector<bool> &visited, int curr, int parent) { | |
visited[curr] = true; | |
for(int adj: G[curr]) { | |
if(!visited[adj]) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Check if there exists a Path from given vertices: (u, v) | |
#include <vector> | |
#include <iostream> | |
#include <algorithm> | |
using namespace std; | |
bool DFSRec(vector<int> *G, int src, int dest, vector<bool> &visited) { | |
if(src == dest) return true; | |
visited[src] = true; | |
for(int u: G[src]) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Problem Link: https://practice.geeksforgeeks.org/problems/depth-first-traversal-for-a-graph/1/ | |
#include <iostream> | |
#include <vector> | |
using namespace std; | |
void DFSRec(vector<int> *G, int s, vector<bool> &visited, vector<int> &vertices) { | |
visited[s] = true; | |
vertices.push_back(s); | |
for(int v: G[s]) |
NewerOlder