Check if all array elements can be converted to pronic numbers by rotating digits Given an array arr[] of size N, the task is to check if it is possible to convert all of array elements to a pronic number by rotating the digits of array elements any number of times. Examples: Input: {321, 402, […]

Continue ReadingIf you’re a developer then building a website and serving it to the users can be the most pleasurable things for you. After all, you worked hard and you tried to create something valuable for the users. When you see a huge number of users have started using your services and day after day the […]

Continue Reading#include using namespace std; class Graph { int V; list* adj; void DFSUtil(int v, bool visited[], int id[], int id_number, int& c); public: Graph(int V); ~Graph(); void addEdge(int v, int w); bool connectedComponents(); }; Graph::Graph(int V) { this->V = V; […]

Continue Reading#include using namespace std; void DFS(unordered_map& adj, int node, vector& visited) { if (visited[node]) return; visited[node] = true; for (auto x : adj[node]) { if (visited[x] == false) DFS(adj, x, visited); } } int makeConnectedUtil(int N, int connections[][2], int M) { vector visited(N, […]

Continue ReadingCount unique substrings of a string S present in a wraparound string Given a string S which is an infinite wraparound string of the string “abcdefghijklmnopqrstuvwxyz”, the task is to count the number of unique non-empty substrings of a string p are present in s. Examples: Input: S = “zab”Output: 6Explanation: All possible substrings are […]

Continue ReadingPart A: Pre-interview assessment (3-4 days virtual) 1. After filling the registration form, each of us was given a problem statement through mail to implement a type-ahead feature similar to Google search for a given set of inputs and a regex for the pattern to be searched. 2. We were given a time period […]

Continue ReadingGGK Tech Interview Experience (On-Campus) GGK Technologies came to our college for placements and they had four rounds of interviews. Written Test: The written test consisted of Aptitude, Reasoning, English, Java coding questions for which output has to be answered. The difficulty level was Easy-medium and I’ve cracked it. On-Paper coding round: They started us […]

Continue Reading#include using namespace std; struct node { int data; struct node *left, *right; }; node* newNode(int key) { node* temp = new node; temp->data = key; temp->left = temp->right = NULL; return (temp); } void printLevelOrder(node* root) { if (!root) return; queue q; q.push(root); while […]

Continue Reading