🚀 Day 48/150 of hashtag#150DaysOfDSA 📌 Task: Valid Perfect Square Given a positive integer num, return true if num is a perfect square or false otherwise. A perfect square is an integer that is the square of an integer (i.e., the product of an integer with itself). You must not use any built-in library function, such as sqrt. #150DaysOfCode #DSA #CPP #Algorithms #CodingJourney #ProblemSolving
Check if number is a perfect square
More Relevant Posts
-
🚀 Day 33/150 of hashtag#150DaysOfDSA 📌 Task: Sqrt(x) Given a non-negative integer x, return the square root of x rounded down to the nearest integer. The returned integer should be non-negative as well. You must not use any built-in exponent function or operator. #150DaysOfCode #DSA #CPP #Algorithms #CodingJourney #LeetCode #ProblemSolving
To view or add a comment, sign in
-
-
🚀 Day 39/150 of hashtag#150DaysOfDSA 📌 Task: Happy Number Write an algorithm to determine if a number n is happy. A happy number is defined by the following process: Starting with any positive integer, replace the number by the sum of the squares of its digits. Repeat the process until the number equals 1 (where it will stay), or it loops endlessly in a cycle which does not include 1. Return true if n is a happy number, and false if not. #150DaysOfCode #DSA #CPP #Algorithms #CodingJourney #ProblemSolving
To view or add a comment, sign in
-
-
🚀 Day 32/150 of hashtag#150DaysOfDSA 📌 Task: Plus One You are given a large integer represented as an integer array digits, where each digits[i] is the ith digit of the integer. The digits are ordered from most significant to least significant in left-to-right order. The large integer does not contain any leading 0's. Increment the large integer by one and return the resulting array of digits. #150DaysOfCode #DSA #CPP #Algorithms #CodingJourney #LeetCode #ProblemSolving
To view or add a comment, sign in
-
-
🚀 Day 35/150 of hashtag#150DaysOfDSA 📌 Task: Linked List Creation (Advanced DSA) Create a singly linked list by inserting multiple nodes at the end and display the complete list. Each node should store an integer value and a pointer to the next node. #150DaysOfCode #DSA #CPP #Algorithms #CodingJourney #ProblemSolving
To view or add a comment, sign in
-
-
🚀 Day 49/150 of hashtag#150DaysOfDSA 📌 Task: Two Sum Given an array of integers nums and an integer target, return indices of the two numbers such that they add up to target. You may assume that each input would have exactly one solution, and you may not use the same element twice. You can return the answer in any order. #150DaysOfCode #DSA #CPP #Algorithms #CodingJourney #ProblemSolving
To view or add a comment, sign in
-
-
53 🚀 Day 53/150 of hashtag#150DaysOfDSA 📌 Task: Non-decreasing Array Given an array nums with n integers, your task is to check if it could become non-decreasing by modifying at most one element. An array is non-decreasing if nums[i] ≤ nums[i + 1] holds for every i (0-based) such that 0 ≤ i ≤ n - 2. #150DaysOfCode #DSA #CPP #Algorithms #CodingJourney #ProblemSolving
To view or add a comment, sign in
-
-
🚀 Day 28/150 of hashtag#150DaysOfDSA 📌 Task: Contains Duplicate Given an integer array nums, return true if any value appears at least twice in the array, and return false if every element is distinct. #150DaysOfCode #DSA #CPP #Algorithms #CodingJourney #LeetCode #ProblemSolving
To view or add a comment, sign in
-
-
🚀 Day 43/150 of hashtag#150DaysOfDSA 📌 Task: Find First and Last Position of Element in Sorted Array Given an array of integers nums sorted in non-decreasing order, find the starting and ending position of a given target value. If target is not found in the array, return [-1, -1]. You must write an algorithm with O(log n) runtime complexity. #150DaysOfCode #DSA #CPP #Algorithms #CodingJourney #ProblemSolving
To view or add a comment, sign in
-
-
🚀 Day 46 of #geekstreak60 Challenge Powered by NPCI ✅ Today’s Problem: Gray Code Generation 🔍 Key Insight: Gray Code ensures that only one bit changes between consecutive numbers. This can be achieved using the reflection method. So, 👉 Take (n-1) Gray code 👉 Add ‘0’ to original sequence 👉 Add ‘1’ to reversed sequence 💡 What I learned: • Understanding Gray Code patterns • Using recursion to build sequences • Reflection technique for sequence generation • Bit manipulation concepts in practice ⚡ This problem showed how a clever pattern (reflection) can help generate complex sequences efficiently. #geekstreak60 #NPCI #Recursion #BitManipulation #Algorithms #CodingJourney 🚀
To view or add a comment, sign in
-
-
🚀 Day 46/150 of hashtag#150DaysOfDSA 📌 Task: Set Mismatch You have a set of integers s, which originally contains all the numbers from 1 to n. Unfortunately, due to some error, one of the numbers got duplicated, resulting in one repeated number and one missing number. You are given an integer array nums representing this incorrect set. Find the number that occurs twice and the number that is missing, and return them in the form of an array. #150DaysOfCode #DSA #CPP #Algorithms #CodingJourney #ProblemSolving
To view or add a comment, sign in
-
Explore content categories
- Career
- Productivity
- Finance
- Soft Skills & Emotional Intelligence
- Project Management
- Education
- Technology
- Leadership
- Ecommerce
- User Experience
- Recruitment & HR
- Customer Experience
- Real Estate
- Marketing
- Sales
- Retail & Merchandising
- Science
- Supply Chain Management
- Future Of Work
- Consulting
- Writing
- Economics
- Artificial Intelligence
- Employee Experience
- Workplace Trends
- Fundraising
- Networking
- Corporate Social Responsibility
- Negotiation
- Communication
- Engineering
- Hospitality & Tourism
- Business Strategy
- Change Management
- Organizational Culture
- Design
- Innovation
- Event Planning
- Training & Development