GeeksforGeeks
18.5K subscribers
1.59K photos
34 videos
24 files
2.59K 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
Must Learn!πŸ’‘
Most technologies that form the foundation of the web as we know it are Open Source starting from the most popular programming languages: HTML, C++, Python, etc. to the Android technology that powers our smartphones.

The Open Source is a vast and expansive space with over 29 million projects coded in the JavaScript language alone. A collaborative platform like Github and the countless submissions made on it every day is just an example of the deep footprint of Open Source in the life of developers.

Link- https://bit.ly/3PnfvRq
Problem Of The Day
"Print first n Fibonacci Numbers"

Given a number N, find the first N Fibonacci numbers. The first two number of the series are 1 and 1.

Example 1:

Input:
N = 5
Output: 1 1 2 3 5

Example 2:

Input:
N = 7
Output: 1 1 2 3 5 8 13

Your Task:
Your task is to complete printFibb() which takes single argument N and returns a list of first N Fibonacci numbers.

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

Note: This space is used to store and return the answer for printing purpose.

Solve and submit your answer here : https://practice.geeksforgeeks.org/problems/print-first-n-fibonacci-numbers1002/1
Must Learn!πŸ’‘
Merge sort is defined as a sorting algorithm that works by dividing an array into smaller subarrays, sorting each subarray, and then merging the sorted subarrays back together to form the final sorted array.

Let us discuss some of the interview questions asked about Merge Sort.

Link- https://bit.ly/3PnbMDv
Problem Of The Day
"Power of 2"

Given a non-negative integer N. The task is to check if N is a power of 2. More formally, check if N can be expressed as 2x for some integer x.

Example 1:

Input:
N = 8
Output:
YES
Explanation:
8 is equal to 2 raised to 3 (23 = 8).

Example 2:

Input:
N = 98
Output:
NO
Explanation:
98 cannot be obtained by any power of 2.

Your Task:
Your task is to complete the function isPowerofTwo() which takes n as a parameter and returns true or false by checking if the given number can be represented as a power of two or not.

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

Solve and submit your answer here : https://practice.geeksforgeeks.org/problems/power-of-2-1587115620/1
Your Words, Your Rewards πŸ’°πŸ”₯

A great opportunity for all the writers out there! Do not miss it, Start Writing Now πŸ’ͺ

Start Writing Now : https://bit.ly/GPL2023
GeeksforGeeks
Job-A-Thon 22 5.pdf
The phone won't stop ringing. πŸ˜ƒ Because this is your career's call! The best organizations are here to add charm to your career. πŸš€

Now, is the time to work with your dream organizations. Job-A-Thon 22 is here!!🎊 Hurry up and register now.

NOTE: This Job-A-Thon 22 is powered by IU University.
Study online with IU & Get Up-to 67% scholarship. Explore tech degrees from IU University.

Register here: https://bit.ly/3PgmFqF
Problem Of The Day
"Find first set bit"

Given an integer N. The task is to return the position of first set bit found from the right side in the binary representation of the number.
Note: If there is no set bit in the integer N, then return 0 from the function.

Example 1:

Input:
N = 18
Output:
2
Explanation:
Binary representation of 18 is 010010,the first set bit from the right side is at position 2.

Example 2:

Input:
N = 12
Output:
3
Explanation:
Binary representation of 12 is 1100, the first set bit from the right side is at position 3.

Your Task:
The task is to complete the function getFirstSetBit() that takes an integer n as a parameter and returns the position of first set bit.

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

Solve and submit your answer here : https://practice.geeksforgeeks.org/problems/find-first-set-bit-1587115620/1
Must Learn! πŸ’‘
A project can be as simple as ensuring the planning of a small-scale event or something as large-scale as the deployment of a worldwide social media application.

The Project Manager is the entity responsible for the smooth execution of these phases.

They achieve the end results by guiding their team members – being responsible for the various aspects of the project and effectively extracting their services to meet the deadlines and produce the outcomes required.

Link- https://bit.ly/3ZpledR
Make the move towards success. πŸ˜ƒ Because the best organizations are here to add charm to your career. πŸš€

Now, is the time to work with your dream organizations. Job-A-Thon 22 is here!!🎊 Hurry up and register now.

NOTE: This Job-A-Thon 22 is powered by IU University.
Study online with IU & Get Up-to 67% scholarship. Explore tech degrees from IU University.

Register here: https://bit.ly/3PgmFqF
Problem Of The Day
"Rotate Bits"

Given an integer N and an integer D, rotate the binary representation of the integer N by D digits to the left as well as right and return the results in their decimal representation after each of the rotation.
Note: Integer N is stored using 16 bits. i.e. 12 will be stored as 0000000000001100.

Example 1:

Input:
N = 28, D = 2
Output:
112
7
Explanation:
28 in Binary is: 0000000000011100
Rotating left by 2 positions, it becomes 0000000001110000 = 112 (in decimal).
Rotating right by 2 positions, it becomes 0000000000000111 = 7 (in decimal).

Example 2:

Input:
N = 29, D = 2
Output:
116
16391
Explanation:
29 in Binary is: 0000000000011101
Rotating left by 2 positions, it becomes 0000000001110100 = 116 (in decimal).
Rotating right by 2 positions, it becomes 100000000000111 = 16391 (in decimal).

Your Task:
You don't need to read input or print anything. Your task is to complete the function rotate() which takes the integer N and integer D as inputs and returns an array of size 2 where arr[0] = Decimal value after left rotation and arr[1] = Decimal value after right rotation.

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

Solve and submit your answer here : https://practice.geeksforgeeks.org/problems/rotate-bits4524/1
Must Learn!πŸ’‘
Relational databases store and manage data in rows and columns, in tabular forms which are used for showing different data and different values.

Some examples of relational databases are MS SQL Server, MySQL, and MS Access. SQL can create, delete, update, and retrieve information from databases. Data Analysts use SQL so that they can optimize database performance.

Link- https://bit.ly/44YtAKW
Problem Of The Day
"Stickler Thief"

Stickler the thief wants to loot money from a society having n houses in a single line. He is a weird person and follows a certain rule when looting the houses. According to the rule, he will never loot two consecutive houses. At the same time, he wants to maximize the amount he loots. The thief knows which house has what amount of money but is unable to come up with an optimal looting strategy. He asks for your help to find the maximum money he can get if he strictly follows the rule. ith house has a[i] amount of money present in it.

Example 1:

Input:
n = 5
a[] = {6,5,5,7,4}
Output:
15
Explanation:
Maximum amount he can get by looting 1st, 3rd and 5th house. Which is 6+5+4=15.

Example 2:

Input:
n = 3
a[] = {1,5,3}
Output:
5
Explanation:
Loot only 2nd house and get maximum amount of 5.

Your Task:
Complete the functionFindMaxSum() which takes an array arr[] and n as input which returns the maximum money he can get following the rules.

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

Solve and submit your answer here : https://practice.geeksforgeeks.org/problems/stickler-theif-1587115621/1
Must Learn!πŸ’‘
Code smell leads to many problems in your code such as poor readability, longer debugging time, or difficulty in maintaining the project for a longer time.

Most often developers follow these bad practices due to the deadline pressure or due to the lack of depth about the entire product. They keep adding and changing the code, but most of the time they forget to improve in the code.

Link- https://bit.ly/3PsIOBT
🚨 Job Alert 🚨
Citi is hiring for Java Developer.

Location - Onsite - Pune (Maharashtra)
Experience - 1+ Years
Apply by - Oct 30, 2023

Apply via the following link and share the opportunity with your friends - https://bit.ly/3PNVVzh
Problem Of The Day
"First and last occurrences of x"

Given a sorted array arr containing n elements with possibly duplicate is to find indexes of first elements, the task is to find the first and last occurrences of an element x in the given array.
Note: If the number x is not found in the array then return both the indices as -1.

Example 1:

Input:
n=9, x=5
arr[] = { 1, 3, 5, 5, 5, 5, 67, 123, 125 }
Output:
2 5
Explanation:
First occurrence of 5 is at index 2 and last occurrence of 5 is at index 5.

Example 2:

Input:
n=9, x=7
arr[] = { 1, 3, 5, 5, 5, 5, 7, 123, 125 }
Output:
6 6
Explanation:
First and last occurrence of 7 is at index 6.

Your Task:
Since, this is a function problem. You don't need to take any input, as it is already accomplished by the driver code. You just need to complete the function find() that takes array arr, integer n and integer x as parameters and returns the required answer.

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

Solve and submit your answer here : https://practice.geeksforgeeks.org/problems/first-and-last-occurrences-of-x3116/1
Must Learn!πŸ’‘
Since React.js is a library of JavaScript, it is very essential to know a clear understanding of JavaScript fundamentals and Syntax.

Having a good knowledge of the JavaScript foundation will help you learn React.js easily and faster. Here are some must-know top JavaScript Concepts before learning React.js.

Link - https://bit.ly/453Acro
Problem Of The Day
"Equilibrium Point"

Given an array A of n positive numbers. The task is to find the first equilibrium point in an array. Equilibrium point in an array is a position such that the sum of elements before it is equal to the sum of elements after it.

Note: Return equilibrium point in 1-based indexing. Return -1 if no such point exists.

Example 1:

Input:
n = 5
A[] = {1,3,5,2,2}
Output:
3
Explanation:
equilibrium point is at position 3 as sum of elements before it (1+3) = sum of elements after it (2+2).

Example 2:

Input:
n = 1
A[] = {1}
Output:
1
Explanation:
Since there's only element hence its only the equilibrium point.

Your Task:
The task is to complete the function equilibriumPoint() which takes the array and n as input parameters and returns the point of equilibrium.

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

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

Solve and submit your answer here : https://practice.geeksforgeeks.org/problems/equilibrium-point-1587115620/1
Must Learn!πŸ’‘
Gurugram is known for having an amazing IT background. The city has created a lot of employment for the younger generation and has now become a dream for the younger aspirants.

Not only industry-wise and financially basis, but the city has also developed in terms of infrastructure and has become one of the posh areas in India. Here is the list of the top 10 IT companies in Gurgaon.

Link- https://bit.ly/3EMQeuP
🚨 Job Alert 🚨
EY is hiring for Software Engineer.

Location - Onsite - Bengaluru (Karnataka)
Experience - 10+ Years
Apply by - Oct 30, 2023

Apply via the following link and share the opportunity with your friends - https://bit.ly/3PPepPU