GeeksforGeeks
17.4K subscribers
1.83K photos
34 videos
24 files
2.76K links
Official Hub βœ…

Your coding haven – where tech meets simplicity.

Discover:
πŸ˜‚ Coding Laughter
πŸ“˜ Curated Study Material
πŸ’Ž Exclusive Offers

Utilize every service we provide and make a promise to find better opportunities for yourself! #gfgkarlohojayega!
Download Telegram
Problem Of The Day
"Nth node from end of linked list"

Solve the problem to win points

Given a linked list consisting of L nodes and given a number N. The task is to find the Nth node from the end of the linked list.

Example 1:
Input:
N = 2
LinkedList: 1->2->3->4->5->6->7->8->9
Output: 8
Explanation: In the first example, there
are 9 nodes in linked list and we need
to find 2nd node from end. 2nd node
from end is 8.

Example 2:
Input:
N = 5
LinkedList: 10->5->100->5
Output: -1
Explanation: In the second example, there
are 4 nodes in the linked list and we
need to find 5th from the end. Since 'n'
is more than the number of nodes in the
linked list, the output is -1.

Your Task:
The task is to complete the function getNthFromLast() which takes two arguments: reference to head and N and you need to return Nth from the end or -1 in case node doesn't exist.

Note:
Try to solve in a single traversal.

Expected Time Complexity: O(N).
Expected Auxiliary Space: O(1).

Solve and submit your answer here : https://practice.geeksforgeeks.org/problems/nth-node-from-end-of-linked-list/1

Powered by hirist.com
Problem Of The Day
"https://practice.geeksforgeeks.org/problems/camelcase-pattern-matching2259/1"

Solve the problem to win points

Given a dictionary of words where each word follows CamelCase notation, print all words (in lexicographical order) in the dictionary that match with a given pattern consisting of uppercase characters only.

Example: GeeksForGeeks matches the pattern "GFG", because if we combine all the capital letters in GeeksForGeeks they become GFG.

CamelCase is the practice of writing compound words or phrases such that each word or abbreviation begins with a capital letter. Common examples include PowerPoint and Wikipedia, GeeksForGeeks, CodeBlocks, etc.

Example 1:https://practice.geeksforgeeks.org/problems/camelcase-pattern-matching2259/1
Input:
N=3
Dictionary=["WelcomeGeek",
"WelcomeToGeeksForGeeks","GeeksForGeeks"]
Pattern="WTG"
Output:
WelcomeToGeeksForGeeks
Explanation:
Since only WelcomeToGeeksForGeeks matches
the pattern, it is the only answer.

Example 2:
Input:
N=8
Dictionary=["Hi","Hello","HelloWorld",
"HiTech","HiGeek","HiTechWorld",
"HiTechCity","HiTechLab"]
Pattern="HA"
Output:
-1
Explanation:
Since the pattern matches none of the words
of the string,the output is -1.

Your Task:
You don't need to read input or print anything. Your Task is to complete the function CamelCase() which takes an integer N, a Vector of strings Dictionary and a string Pattern and returns the strings in the dictionary that match the pattern, if not found any return -1.

Expected Time Complexity: O(N*|S|) S=Longest string in Dictionary
Expected Auxillary Space: O(26*N)

Solve and submit your answer here : https://practice.geeksforgeeks.org/problems/nth-node-from-end-of-linked-list/1

Powered by hirist.com
πŸ‘3
Must Learn!πŸ’‘
Search engine optimization (SEO) is typical to practice for contemporary e-commerce platforms to use keywords to grab the interest of web search bots like Google.

If you’re experiencing technical SEO issues, likely, your SEO strategies won’t yield the desired outcomes.

So, you must comprehend technical SEO and know how to do it correctly. Thus in this article, we’ll provide you with a detailed explanation of technical SEO.

Link- https://www.geeksforgeeks.org/what-is-technical-seo/?utm_source=telegram&utm_medium=marketingteam_gfgmain&utm_campaign=technicalseo
Problem Of The Day
"Word Search"

Solve the problem to win points

Given a 2D board of letters and a word. Check if the word exists in the board. The word can be constructed from letters of adjacent cells only. ie - horizontal or vertical neighbors. The same letter cell can not be used more than once.

Example 1:
Input: board = {{a,g,b,c},{q,e,e,l},{g,b,k,s}},
word = "geeks"
Output: 1
Explanation: The board is-
a g b c
q e e l
g b k s
The letters which are used to make the
"geeks" are colored.

Example 2:
Input: board = {{a,b,c,e},{s,f,c,s},{a,d,e,e}},
word = "sabfs"
Output: 0
Explanation: The board is-
a b c e
s f c s
a d e e
Same letter can not be used twice hence ans is 0

Your Task:
You don't need to read or print anything. Your task is to complete the function isWordExist() which takes board and word as input parameter and returns boolean value true if word can be found otherwise returns false.

Expected Time Complexity: O(N * M * 4L) where N = No. of rows in board, M = No. of columns in board, L = Length of word
Expected Space Compelxity: O(L), L is length of word.

Solve and submit your answer here : https://practice.geeksforgeeks.org/problems/word-search/1

Powered by hirist.com
πŸ‘2
Must Learn!πŸ’‘
Gamers on PCs and consoles may both advantage from the best gaming monitors. They can therefore handle games more adeptly than a standard monitor, especially those that are fast-paced.

Several panel types, including IPS, TN, VA, and even OLED (opens in new tab), are competing for your attention while looking for the top gaming monitor for your setup.

We haven’t even touched on the extras like speakers, RGB, or port choice. There are still plenty of options accessible to gamers, so we reviewed a lot of displays and put together a list of the top 10. Give it a read.

Link- https://www.geeksforgeeks.org/10-gaming-monitors-for-an-immersive-gaming-experience/?utm_source=telegram&utm_medium=marketingteam_gfgmain&utm_campaign=10gamingmonitors
πŸ‘1
Problem Of The Day
"Frequency Game"

Solve the problem to win points

Given an array A of size N. The elements of the array consist of positive integers. You have to find the largest element with minimum frequency.

Example 1:
Input:
5
2 2 5 50 1
Output:
50
Explanation :
All elements are having frequency 1 except 2.
50 is the maximum element with minimum frequency.

Example 2:
Input:
4
3 3 5 5
Output:
5
Explanation:
Both 3 and 5 have the same frequency, so 5 should be returned.

User Task:
Your task is to complete the provided function LargButMinFreq(A, n) which accepts array A and n. Hence you have to return the largest element with minimum frequency.

Expected Time Complexity: O(N)
Expected Space Complexity: O(N)

Solve and submit your answer here : https://practice.geeksforgeeks.org/problems/frequency-game/1

Powered by hirist.com
🚨Job Alert🚨
MakeMyTrip is hiring for Sr. Tech lead.

Location - Banglore/ gurgram
Experience - 5+ Years
Apply by - Jun 25, 2023

Apply via the following link and share the opportunity with your friends- https://www.geeksforgeeks.org/jobs/makemytripleadjava?utm_source=telegram&utm_medium=marketingteam_gfgmain&utm_campaign=makemytripleadjava
❀1
Must Learn!πŸ’‘
Be it on the internet or in reality, sharing resources is what makes the world function.

It is important to how and where we store or share our data on the internet, which is when cloud computing comes into play.

Here, in this article, we have discussed various books on cloud computing, especially for beginners.

Link- https://www.geeksforgeeks.org/best-cloud-computing-books-for-beginners/?utm_source=tele[…]ium=marketingteam_gfgmain&utm_campaign=cloudcomputingbooks
Problem Of The Day
"Topological sort"

Solve the problem to win points

Given a Directed Acyclic Graph (DAG) with V vertices and E edges, Find any Topological Sorting of that Graph.

Example 1:
Input:

Output:
1
Explanation:
The output 1 denotes that the order is
valid. So, if you have, implemented
your function correctly, then output
would be 1 for all test cases.
One possible Topological order for the
graph is 3, 2, 1, 0.

Example 2:
Input:

Output:
1
Explanation:
The output 1 denotes that the order is
valid. So, if you have, implemented
your function correctly, then output
would be 1 for all test cases.
One possible Topological order for the
graph is 5, 4, 2, 1, 3, 0.

Your Task:
You don't need to read input or print anything. Your task is to complete the function topoSort() which takes the integer V denoting the number of vertices and adjacency list as input parameters and returns an array consisting of the vertices in Topological order. As there are multiple Topological orders possible, you may return any of them. If your returned topo sort is correct then the console output will be 1 else 0.

Expected Time Complexity: O(V + E).
Expected Auxiliary Space: O(V).

Solve and submit your answer here : https://practice.geeksforgeeks.org/problems/topological-sort/1

Powered by hirist.com
πŸ‘1
Must Learn!πŸ’‘
Say goodbye to job insecurity and hello to lucrative opportunities. Discover the secrets to thriving in the AI revolution and take your career to new heights.

Don’t let automation steal your thunder – embrace the future and become an AI trailblazer with our expert tips and insider insights with this article. Give it a read.

Link- https://www.geeksforgeeks.org/hottest-job-of-2023-with-2cr-salary-ai-prompt-engineering[…]medium=marketingteam_gfgmain&utm_campaign=hottestjobof2023
Problem Of The Day
"Santa Banta"

Solve the problem to win points

Santa is still not married. He approaches a marriage bureau and asks them to hurry the process. The bureau checks the list of eligible girls of size N and hands it over to Santa. Santa being conscious about his marriage is determined to find a girl with maximum connections so that he can gather more information about her. Accordingly, he looks to figure out the maximum number of girls (from the list) who know each other to achieve the above purpose.

In order to finalize the girl, he needs to find the Kth prime. Where k = largest group of girls who know each other. Considering Santa's poor knowledge of Maths, he seeks Banta's help for the answer. Now you, a fan of Santa Banta Jokes, take this prestigious opportunity to solve the problem.

In case no of connections is zero, print "-1". Here the connection between girls is represented by a 2-D array arr of dimension M*2, where M is the number of connections.

Note :
1. Suppose girl "a" knows girl "b" and girl "b" knows girl "c", then girl "a" also knows girl "c". Transitivity holds here.
2. Consider 1 as a composite number.
3. For precompute function given in the template you just have to complete it and use it wherever required, do not call it again and again, it is already being called by driver function before executing test cases.

Example 1:
Input :
arr[] = {{1,2},{2,3},{3,4},{4,5},{6,7},{9,10}}
N = 10 and M = 6
Output :
11
Explanation:
Here in this graph there are 4 groups.
In 1st group: (1 -> 2 -> 3 -> 4 -> 5) are
there. In 2nd group: (6 -> 7) are there.
In 3rd group: (8) is there.
In 4th group: (10 -> 9) are there.
In these 4 group the maximum number of
value is 5. So, K = 5 and the 5th prime number
is 11. Return 11.

Example 2:
Input :
arr[ ] = {{1, 2}}
N = 2 and M = 1
Output :
3
Explanation:
In this Example there will only be a
single group of 2 girls, and hence the
value of K is 2, The 2nd prime is 3.

Your Task:
This is a function problem. The input is already taken care of by the driver code. You only need to complete the function helpSanta() that takes a number of girls (n), a number of connections (m), an adjacency list of girls connections (g), and return the Kth prime no if there are no connections then return -1. The driver code takes care of the printing.

Expected Time Complexity: O(N + M).
Expected Auxiliary Space: O(N + M).

Solve and submit your answer here : https://practice.geeksforgeeks.org/problems/santa-banta2814/1

Powered by hirist.com
πŸ‘1
Must Learn!πŸ’‘
If you’re a fellow ChatGPT aficionado, then get ready to witness the rise of an AI language model that’s shaking up the field: Google BARD.

It’s time to say goodbye to ChatGPT because BARD is bringing some serious firepower to the table. With its mind-blowing capabilities, BARD is taking AI-driven conversations to a whole new level.

Let’s dive in and explore the 7 features that make Google’s BARD an absolute force to be reckoned with. Give it a read.

Link- https://www.geeksforgeeks.org/7-google-bard-ai-features-that-is-beating-chatgpt/?utm_source=Telegram&utm_medium=marketingteam_gfgmain&utm_campaign=7-google-bard-ai-features-that-is-beating-chatgpt%2F
🚨Job Alert🚨
Bepoj Technology is hiring for BUSINESS SYSTEMS ANALYST.

Location - Mohali, Punjab
Experience - 1 - 2 Year
Apply by - Jun 30, 2023

Apply via the following link and share the opportunity with your friends- https://www.geeksforgeeks.org/jobs/bepoj-bsa?utm_source=telegram&utm_medium=marketingteam_gfgmain&utm_campaign=bepoj-bsa
πŸ‘1
Problem Of The Day
"Find Maximum Equal sum of Three Stacks"

Solve the problem to win points

Given three stacks S1, S2 & S3 of size N1, N2 & N3 respectively, having only Positive Integers. The task is to find the possible equal maximum sum of the stacks with the removal of top elements allowed. Stacks are represented as an array, and the first index of the array represents the top element of the stack.

Example 1:
Input:
N1 = 3, N2 = 4, N3 = 2
S1 = {4,2,3}
S2 = {1,1,2,3}
S3= {1,4}
Output:
5
Explanation:
We can pop 1 element from the 1st stack, and 2
elements from the 2nd stack. Now remaining elements
yield the equal sum of the three stacks, that is 5.

Example 2:
Input:
N1 =2, N2 = 1, N3 = 3
S1 = {4,7}
S2 = {10}
S3 = {1,2,3}
Output:
0
Explanation:
We will never get an equal sum after popping
some elements, so the answer will be 0.

Your Task:
You don't need to read input or print anything. Your task is to complete the function maxEqualSum() which takes the arrays S1[], S2[], and S3[] and their sizes N1, N2, and N3 as inputs and returns the maximum equal sum we can obtain.

Expected Time Complexity: O(N1+N2+N3)
Expected Auxiliary Space: O(1)

Solve and submit your answer here : https://practice.geeksforgeeks.org/problems/find-maximum-equal-sum-of-three-stacks/1

Powered by hirist.com
πŸ‘1
Must Learn!πŸ’‘
It accepts text inputs called β€˜prompts’ and replies in text only. It is similar to providing more details in an address to reach the desired location more accurately.

How to formulate the β€˜prompt’ to get more accurate and precise answers? So, we have listed top 20 ChatGPT prompts for software Developers. You will learn via this article. Give it a read.

Link- https://www.geeksforgeeks.org/chatgpt-prompts-for-software-developers/?utm_source=telegram&utm_medium=marketingteam_gfgmain&utm_campaign=chatgptprompts
🚨Job Alert🚨
Licious is hiring for SDE - 3 Backend Engineer.

Location - Bengaluru
Experience - 6 - 8 Years
Apply by - Jun 31, 2023

Apply via the following link and share the opportunity with your friends- https://www.geeksforgeeks.org/jobs/licious-backendengineer?utm_source=telegram&utm_medium=marketingteam_gfgmain&utm_campaign=licious-backendengineer
Problem Of The Day
"Reversing the equation"

Solve the problem to win points

Given a mathematical equation that contains only numbers and +, -, *, /. Print the equation in reverse, such that the equation is reversed, but the numbers remain the same.
It is guaranteed that the given equation is valid, and there are no leading zeros.

Example 1:
Input:
S = "20-3+5*2"
Output: 2*5+3-20
Explanation: The equation is reversed with
numbers remaining the same.

Example 2:
Input:
S = "5+2*56-2/4"
Output: 4/2-56*2+5
Explanation: The equation is reversed with
numbers remaining the same.

Your Task:
You don't need to read input or print anything. Your task is to complete the function reverseEqn() which takes the string S representing the equation as input and returns the resultant string representing the equation in reverse.

Expected Time Complexity: O(|S|).
Expected Auxiliary Space: O(|S|).

Solve and submit your answer here : https://practice.geeksforgeeks.org/problems/reversing-the-equation2205/1

Powered by hirist.com
πŸ‘1
Must Learn!πŸ’‘
Antivirus software is a type of program designed to protect computers and other devices from malicious software, commonly referred to as malware.

Antivirus software works by scanning files and programs on your computer and comparing them to a database of known malware signatures.

This article lists out best antiviruses for secure browsing.

Link- https://www.geeksforgeeks.org/best-antiviruses-for-secure-browsing/?utm_source=telegram&utm_medium=marketingteam_gfgmain&utm_campaign=bestantiviruses
πŸ‘1
🚨Job Alert🚨
CEDCOSS Technologies is hiring for Associate Software Engineer.

Location - Lucknow, Uttar Pradesh
Experience - Fresher
Apply by - Jun 31, 2023

Apply via the following link and share the opportunity with your friends- https://www.geeksforgeeks.org/jobs/associatesoftwareengineer-cedcoss?utm_source=telegram&utm_medium=marketingteam_gfgmain&utm_campaign=associatesoftwareengineer-cedcoss
Problem Of The Day
"Find the Closest Element in BST"

Solve the problem to win points

Given a BST and an integer. Find the least absolute difference between any node value of the BST and the given integer.

Example 1:
Input:
10
/ \
2 11
/ \
1 5
/ \
3 6
\
4
K = 13
Output: 2
Explanation: K=13. The node that has
value nearest to K is 11. so the answer
is 2

Example 2:
Input:
8
/ \
1 9
\ \
4 10
/
3
K = 9
Output: 0
Explanation: K=9. The node that has
value nearest to K is 9. so the answer
is 0.

Your Task:
You don't need to read input or print anything. Your task is to complete the function minDiff() that takes the root of the BST and an integer K as its input and returns the minimum absolute difference between any node value of the BST and the integer K.

Expected Time Complexity: O(Height of the BST).
Expected Auxiliary Space: O(Height of the BST).

Solve and submit your answer here : https://practice.geeksforgeeks.org/problems/find-the-closest-element-in-bst/1

Powered by hirist.com
πŸ‘4