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
GeeksforGeeks
Mega Job-A-Thon Freshers -1 (1).pdf
Exclusively for Freshers! πŸŽ‰
We bet you don't wanna miss these opportunities.πŸ˜ƒπŸŽŠ No more tension of placement because we got your back!πŸ•Ί

Don't wait! Register and be eligible for your own hiring challenge and grab the best opportunities.πŸ‘©β€πŸ’»

Register here:
Key Software- https://bit.ly/46exlO0
SkyAch- https://bit.ly/3qWy46s
CEDCOSS Technologies- https://bit.ly/3CDeTRt
Saturo Technologies- https://bit.ly/46delQ1
Instient- https://bit.ly/44cDt7w
πŸ‘4
Problem Of The Day
"Lemonade Change"

You are an owner of lemonade island, each lemonade costs $5. Customers are standing in a queue to buy from you and order one at a time (in the order specified by given array bills[]). Each customer will only buy one lemonade and pay with either a $5, $10, or $20 bill. You must provide the correct change to each customer so that the net transaction is that the customer pays $5.

NOTE: At first, you do not have any bill to provide changes with. You can provide changes from the bills that you get from the previous customers.

Given an integer array bills of size N where bills [ i ] is the bill the ith customer pays, return true if you can provide every customer with the correct change, or false otherwise.

Example 1:
Input:
N = 5
bills [ ] = {5, 5, 5, 10, 20}
Output: True
Explanation:
From the first 3 customers, we collect three $5 bills in order.
From the fourth customer, we collect a $10 bill and give back a $5.
From the fifth customer, we give a $10 bill and a $5 bill.
Since all customers got correct change we return true.


Example 2:
Input:
N = 5
bills [ ] = {5, 5, 10, 10, 20}
Output: False
Explanation:
From the first two customers in order, we collect two $5 bills.
For the next two customers in order, we collect a $10 bill and give back a $5 bill.
For the last customer, we can not give the change of $15 back because we only have two $10 bills.
Since not every customer received the correct change, the answer is false.


Your Task:
You don't need to read input or print anything. Your task is to complete the function lemonadeChange() which takes the interger N and integer array bills [ ] as parameters and returns true if it is possible to provide change to every customer otherwise false.

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

Solve and submit your answer here : https://practice.geeksforgeeks.org/problems/lemonade-change/1
πŸ‘8
Must Learn!πŸ’‘
Plugins are a third-party software, which helps designers to complete the work in less time and increase the capability of Figma.

Figma offers a wide range of Plugins that enhanced the capability of designers. The list of 15 Figma Plugins includes the top trending plugins based on color styles, mockups, AI-generated tools, Images, icons and graphics generating tools, etc are explained here.

Link- https://www.geeksforgeeks.org/best-figma-plugins-for-ui-ux-designers/?utm_source=telegram&utm_medium=marketingteam_gfgmain&utm_campaign=github
Problem Of The Day
"Task Scheduler"

Given a character array tasks of size N, representing the tasks a CPU needs to do, where each letter represents a different task. Tasks could be done in any order. Each task is done in one unit of time. For each unit of time, the CPU could complete either one task or just be idle.

CPU has a cooldown period for each task. CPU can repeat a task only after atleast K units of time has passed after it did same task last time. It can perform other tasks in that time, can stay idle to wait for repeating that task.

Return the least number of units of times that the CPU will take to finish all the given tasks.

Example 1:
Input:
N = 6
K = 2
task[ ] = {'A', 'A', 'A', 'B', 'B', 'B'}
Output: 8
Explanation:
A -> B -> idle -> A -> B -> idle -> A -> B
There is atleast 2 units of time between any two same tasks.

Example 2:
Input:
N = 12
K = 2
task[ ] = {'A', 'A', 'A', 'A', 'A', 'A', 'B', 'C', 'D', 'E', 'F', 'G'}
Output: 16
Explanation:
One possible solution is
A -> B -> C -> A -> D -> E -> A -> F -> G -> A -> idle -> idle -> A -> idle -> idle -> A.


Your Task:
You don't need to read input or print anything. Your task is to complete the function leastInterval() which takes the interger N, integer K and an character array tasks as parameters and returns the minimum unit of time required to complete all tasks.

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

Solve and submit your answer here : https://practice.geeksforgeeks.org/problems/task-scheduler/1
❀1πŸ‘1πŸ”₯1πŸ€”1
Must Learn!πŸ’‘
Software documentation tools are software applications or services that help developers and technical writers create, manage, and publish software documentation.

These tools provide a range of features to help streamline the documentation process and make it easier for users to create and maintain documentation.

This article talks about top 10 free software documentation tools. Give it a read.

Link- https://www.geeksforgeeks.org/top-10-free-software-documentation-tools/?utm_source=telegram&utm_medium=marketingteam_gfgmain&utm_campaign=github
GeeksforGeeks
Mega Job-A-Thon (For Freshers) 2.pdf
Exclusively for Freshers! πŸŽ‰
Have you not registered yet?πŸ€” What are you waiting for?πŸ€·πŸ»β€β™€οΈ No more tension of placement because we got your back!πŸ•Ί

Don't wait! Register and be eligible for your own hiring challenge and grab the best opportunities.πŸ‘©β€πŸ’»

Register here:
Brisa technologies- https://bit.ly/44hoOrI
Plugin Coders- https://bit.ly/3qUm997
Mtalkz- https://bit.ly/3PsNNEf
Alphaware- https://bit.ly/3No41fx
Formi- https://bit.ly/3NqMaEH

Mega Job-A-Thon details here: https://practice.geeksforgeeks.org/contest/megajob-a-thon-hiring-challenge-freshers?utm_source=telegram&utm_medium=marketingteam_gfgmain&utm_campaign=megajobathon
❀2πŸ‘1
Problem Of The Day
"Prefix match with other strings"

Given an array of strings arr[] of size n, a string str and an integer k. The task is to find the count of strings in arr[] whose prefix of length k matches with the k-length prefix of str.

Example 1:
Input:
n = 6
arr[] = {β€œabba”, β€œabbb”, β€œabbc”, β€œabbd”,
β€œabaa”, β€œabca”}
str = β€œabbg”
k = 3
Output:
4
Explanation:
β€œabba”, β€œabbb”, β€œabbc” and β€œabbd” have their prefix of length 3 equal to 3-length prefix of str i.e., "abb".

Example 2:
Input:
n = 3
arr[] = {β€œgeeks”, β€œgeeksforgeeks”, β€œforgeeks”}
str = β€œgeeks”
k = 2
Output:
2
Explanation:
β€œgeeks” and β€œgeeksforgeeks” have their prefix of length 2 equal to 2-length prefix of str i.e., "ge".

Your Task:
You don't need to read input or print anything. Your task is to complete the function klengthpref() which takes the array of strings arr[], its size n and an integer k, a string str as input parameters and returns the count of strings in arr[] whose prefix of length k matches with the k length prefix of str.

Expected Time Complexity: O(n*l) where l is the length of the longest word in arr[].
Expected Auxiliary Space: O(n*l) where l is the length of the longest word in arr[].

Solve and submit your answer here : https://practice.geeksforgeeks.org/problems/prefix-match-with-other-strings/1
πŸ‘1
Problem Of The Day
"Unique rows in boolean matrix"

Given a binary matrix your task is to find all unique rows of the given matrix in the order of their appearance in the matrix.

Example 1:

Input:
row = 3, col = 4
M[][] = {{1 1 0 1},{1 0 0 1},{1 1 0 1}}
Output: $1 1 0 1 $1 0 0 1 $
Explanation: Above the matrix of size 3x4
looks like
1 1 0 1
1 0 0 1
1 1 0 1
The two unique rows are R1: {1 1 0 1} and R2: {1 0 0 1}.
As R1 first appeared at row-0 and R2 appeared at row-1, in the resulting list, R1 is kept before R2.

Example 2:

Input:
row = 2, col = 4
M[][] = {{0 0 0 1}, {0 0 0 1}}
Output: $0 0 0 1 $
Explanation: Above the matrix of size 3x4
looks like
0 0 0 1
0 0 0 1
Only unique row is $0 0 0 1 $

Your Task:
You only need to implement the given function uniqueRow(). The function takes three arguments the first argument is a matrix M and the next two arguments are row and col denoting the rows and columns of the matrix. The function should return the list of the unique row of the martrix. Do not read input, instead use the arguments given in the function.

Note: The drivers code print the rows "$" separated. You have to just return list of rows, you do not have to worry about printing anything.

Expected Time Complexity: O(row * col)
Expected Auxiliary Space: O(row * col)

Solve and submit your answer here : https://practice.geeksforgeeks.org/problems/unique-rows-in-boolean-matrix/1
πŸ‘3😁1
Problem Of The Day
"nCr"

Given two integers n and r, find nCr. Since the answer may be very large, calculate the answer modulo 109+7.

Example 1:

Input: n = 3, r = 2
Output: 3
Explaination: 3C2 = 3.

Example 2:

Input: n = 2, r = 4
Output: 0
Explaination: r is greater than n.

Your Task:
You do not need to take input or print anything. Your task is to complete the function nCr() which takes n and r as input parameters and returns nCr modulo 109+7..

Expected Time Complexity: O(n*r)
Expected Auxiliary Space: O(r)

Solve and submit your answer here : https://practice.geeksforgeeks.org/problems/ncr1019/1
Must Learn!πŸ’‘
Women in tech refers to women’s involvement in the technology field. In the past, most tech jobs were held by men, and women faced barriers to entering and advancing in the industry.

However, there is a growing recognition of the importance of diversity in tech, and efforts are being made to support and empower women in this field.

This article talks about top programs for women in tech. Give it a read.

Link- https://www.geeksforgeeks.org/top-programs-for-women-in-tech/?utm_source=telegram&utm_medium=marketingteam_gfgmain&utm_campaign=github
Who says geeks don't have fun? This Geek-O-Lympics gives you a chance to explore and participate in a wide range of events.πŸ₯³πŸ•Ί

Sharpen up your programming skills, participate in coding contests, explore high-paying jobs & stand a chance to win medals while participating for FREE!πŸ…πŸ₯‡πŸ₯ˆπŸ₯‰

Explore the events starting from 1st July 2023...

Register now: https://www.geeksforgeeks.org/geek-olympics-2023?utm_source=telegram&utm_medium=marketingteam_gfgmain&utm_campaign=gol2023
GeeksforGeeks
Mega Job-A-Thon (for Freshers) 3.pdf
Exclusively for Freshers! πŸŽ‰ Bringing the best to you.πŸ˜ƒπŸ‘
You don't have to be worried about placements, because we are here with Mega Job-A-Thon exclusively for you.πŸ•Ί

Don't wait! Register and be eligible for your own hiring challenge and grab the best opportunities.πŸ‘©β€πŸ’»

Register here:
Allengers- https://bit.ly/43ZU9PY
V2STech Solutions (Java Trainee Developer)- https://bit.ly/3CMp9XL
Saturo Technologies- https://bit.ly/44dnQga
Formi- https://bit.ly/3r1k5MF
V2STech Solutions (Python Trainee Developer)- https://bit.ly/3XoCNKa

Mega Job-A-Thon details here: https://practice.geeksforgeeks.org/contest/megajob-a-thon-hiring-challenge-freshers?utm_source=telegram&utm_medium=marketingteam_gfgmain&utm_campaign=megajobathon
πŸ‘2
Problem Of The Day
"Union of Two Linked Lists"

Given two linked lists, your task is to complete the function makeUnion(), that returns the union list of two linked lists. This union list should include all the distinct elements only and it should be sorted in ascending order.

Example 1:

Input:
L1 = 9->6->4->2->3->8
L2 = 1->2->8->6->2
Output:
1 2 3 4 6 8 9
Explaination:
All the distinct numbers from two lists, when sorted forms the list in the output.

Example 2:

Input:
L1 = 1->5->1->2->2->5
L2 = 4->5->6->7->1
Output:
1 2 4 5 6 7
Explaination:
All the distinct numbers from two lists, when sorted forms the list in the output.

Your Task:
The task is to complete the function makeUnion() which makes the union of the given two lists and returns the head of the new list.

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

Solve and submit your answer here : https://practice.geeksforgeeks.org/problems/union-of-two-linked-list/1
πŸ‘2
Problem Of The Day
"Maximum Depth Of Binary Tree"

Given a binary tree, find its maximum depth.
A binary tree's maximum depth is the number of nodes along the longest path from the root node down to the farthest leaf node.

Example 1:

Input:
root --> 1
/ \
3 2
/
4
Output: 3
Explanation:
Maximum depth is between nodes 1 and 4, which is 3.

Example 2:

Input:
root --> 10
/ \
20 30
\ \
40 60
/
2
Output: 4
Explanation:
Maximum depth is between nodes 10 and 2, which is 4

Your Task:
You don't need to read input or print anything. Complete the function maxDepth() which takes the root node as an input parameter and returns the maximum depth.

Expected Time Complexity: O(N)
Expected Auxiliary Space: O(height of the tree)

Solve and submit your answer here : https://practice.geeksforgeeks.org/problems/maximum-depth-of-binary-tree/1
Must Learn!πŸ’‘
Ever since OpenAI launched ChatGPT, it has got popular among every individual. It has gained popularity among all communities be they school students, graduates, or working professionals.

Every sector of industry uses ChatGPT to its fullest extent. You can also use it to enhance your learning experience with ChatGPT and walk with the trend.

In this article, we’ll be focusing on some of the best ChatGPT prompts which students can use to improve their learning.

Link- https://www.geeksforgeeks.org/chatgpt-prompts-for-students/?utm_source=telegram&utm_medium=marketingteam_gfgmain&utm_campaign=github
GeeksforGeeks
Meag Job-A-Thon for Freshers (4).pdf
Exclusively for Freshers! :tada: Back with the best opportunities.πŸ˜ƒπŸ‘
Now, you don't have to be worried about placements, because we are here with Mega Job-A-Thon exclusively for you.πŸ•Ί

Don't wait! Register and be eligible for your own hiring challenge and grab the best opportunities.πŸ‘©β€πŸ’»

Register here:
Flipshope- https://bit.ly/44F76in
Acnovate Corporation- https://bit.ly/44eiUrG
PayNet Systems- https://bit.ly/3pk5coj
TechSolv IT Services- https://bit.ly/3PyFXcg
Zopper- https://bit.ly/3NxzMmn

Mega Job-A-Thon details here: https://practice.geeksforgeeks.org/contest/megajob-a-thon-hiring-challenge-freshers?utm_source=telegram&utm_medium=marketingteam_gfgmain&utm_campaign=megajobathon