🌟Day - 61🌟 Hello Connection! This is day 61 of my 💯 days leetcode challenge Today's Problem 1️⃣ Problem :- Permutations Description :-Given an array nums of distinct integers, return all the possible permutations.You can return the answer in any order. Example 1: Input: nums = [1,2,3] Output: [[1,2,3],[1,3,2],[2,1,3],[2,3,1],[3,1,2],[3,2,1]] #Leetcode #Leetcode100dayschallenge #C++ #skillswallah #Day61 #consistency #DSA #leetcode160+ #PW #Skilkswallah
Goutam Sharma’s Post
More Relevant Posts
-
🌟Day - 76🌟 Hello Connection! This is day 76 of my 💯 days leetcode challenge Today's Problem 1️⃣ Problem :- Swap Nodes in Pairs Description :-Given a linked list, swap every two adjacent nodes and return its head. You must solve the problem without modifying the values in the list's nodes (i.e., only nodes themselves may be changed.) Example 1: Input: head = [1,2,3,4] Output: [2,1,4,3] #Leetcode #Leetcode100dayschallenge #C++ #skillswallah #Day76 #consistency #DSA #leetcode170+ #PW #Skilkswallah
To view or add a comment, sign in
-
🌟Day - 89🌟 Hello Connection! This is day 89 of my 💯 days Leetcode Challenge Today's Problem 1️⃣ Problem :- N th Magical Number Description :-A positive integer is magical if it is divisible by either a or b.Given the three integers n, a, and b, return the nth magical number. Since the answer may be very large, return it modulo 109 + 7. Example 1: Input: n = 1, a = 2, b = 3 Output: 2 Example 2: Input: n = 4, a = 2, b = 3 Output: 6 #LeetCode #Leetcode100dayschallenge #C++ #skillswallah #Day89 #consistency #DSA #leetcode190+ #PW #Skilkswallah
To view or add a comment, sign in
-
🌟Day - 54🌟 Hello Connection! This is day 54 of my 💯 days leetcode challenge Today's Problem 1️⃣ Problem :- Generate Parentheses Description :-.Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses. Example 1: Input: n = 3 Output: ["((()))","(()())","(())()","()(())","()()()"] #Leetcode #Leetcode100dayschallenge #C++ #skillswallah #Day54 #consistency #DSA #leetcode150+ #PW #Skilkswallah
To view or add a comment, sign in
-
🌟Day - 87🌟 Hello Connection! This is day 87 of my 💯 days Leetcode Challenge Today's Problem 1️⃣ Problem :- Reaching Points Description :-Given four integers sx, sy, tx, and ty, return true if it is possible to convert the point (sx, sy) to the point (tx, ty) through some operations, or false otherwise.The allowed operation on some point (x, y) is to convert it to either (x, x + y) or (x + y, y). Example 1: Input: sx = 1, sy = 1, tx = 3, ty = 5 Output: true Explanation: One series of moves that transforms the starting point to the target is: (1, 1) -> (1, 2) (1, 2) -> (3, 2) (3, 2) -> (3, 5) #LeetCode #Leetcode100dayschallenge #C++ #skillswallah #Day87 #consistency #DSA #leetcode190+ #PW #Skilkswallah
To view or add a comment, sign in
-
🌟Day - 53🌟 Hello Connection! This is day 53 of my 💯 days leetcode challenge Today's Problem 1️⃣ Problem :- Combination Sum Description :-Given an array of distinct integers candidates and a target integer target, return a list of all unique combinations of candidates where the chosen numbers sum to target. You may return the combinations in any order.The same number may be chosen from candidates an unlimited number of times. Two combinations are unique if the frequency of at least one of the chosen numbers is different. The test cases are generated such that the number of unique combinations that sum up to target is less than 150 combinations for the given input. Example 1: Input: candidates = [2,3,6,7], target = 7 Output: [[2,2,3],[7]] Explanation: 2 and 3 are candidates, and 2 + 2 + 3 = 7. Note that 2 can be used multiple times. 7 is a candidate, and 7 = 7. #Leetcode #Leetcode100dayschallenge #C++ #skillswallah #Day53 #consistency #DSA #leetcode150+ #PW #Skilkswallah
To view or add a comment, sign in
-
🌟Day - 58🌟 Hello Connection! This is day 58 of my 💯 days leetcode challenge Today's Problem 1️⃣ Problem :- Combination Sum II Description :-Given a collection of candidate numbers (candidates) and a target number (target), find all unique combinations in candidates where the candidate numbers sum to target.Each number in candidates may only be used once in the combination.Note: The solution set must not contain duplicate combinations. Example 1: Input: candidates = [10,1,2,7,6,1,5], target = 8 Output: [ [1,1,6], [1,2,5], [1,7], [2,6] ] #Leetcode #Leetcode100dayschallenge #C++ #skillswallah #Day58 #consistency #DSA #leetcode150+ #PW #Skilkswallah
To view or add a comment, sign in
-
🌟Day - 96🌟 Hello Connection! This is day 96 of my 💯 days Leetcode Challenge Today's Problem 1️⃣ Problem :- N-Queens II Description :-The n-queens puzzle is the problem of placing n queens on an n x n chessboard such that no two queens attack each other.Given an integer n, return the number of distinct solutions to the n-queens puzzle. Example : Input: n = 4 Output: 2 Explanation: There are two distinct solutions to the 4-queens puzzle as shown. Example 2: Input: n = 1 Output: 1 #LeetCode #Leetcode100dayschallenge #C++ #skillswallah #Day96 #consistency #DSA #leetcode210+ #PW #Skilkswallah
To view or add a comment, sign in
-
🌟Day - 68🌟 Hello Connection! This is day 68 of my 💯 days leetcode challenge Today's Problem 1️⃣ Problem :- Maximum Swap Description :-You are given an integer num. You can swap two digits at most once to get the maximum valued number.Return the maximum valued number you can get. Example 1: Input: num = 2736 Output: 7236 Explanation: Swap the number 2 and the number 7. #Leetcode #Leetcode100dayschallenge #C++ #skillswallah #Day68 #consistency #DSA #leetcode170+ #PW #Skilkswallah
To view or add a comment, sign in
-
🌟Day - 81🌟 Hello Connection! This is day 81 of my 💯 days leetcode challenge Today's Problem 1️⃣ Problem :- Regular Expression Matching Description :-Given an input string s and a pattern p, implement regular expression matching with support for '.' and '*' where: '.' Matches any single character. '*' Matches zero or more of the preceding element. The matching should cover the entire input string (not partial). Example 1: Input: s = "aa", p = "a" Output: false Explanation: "a" does not match the entire string "aa". #Leetcode #Leetcode100dayschallenge #C++ #skillswallah #Day81 #consistency #DSA #leetcode170+ #PW #Skilkswallah
To view or add a comment, sign in
-
🌟Day - 52🌟 Hello Connection! This is day 52 of my 💯 days leetcode challenge Today's Problem 1️⃣ Problem :- Merge k sorted Lists Description :- You are given an array of k linked-lists lists, each linked-list is sorted in ascending order. Merge all the linked-lists into one sorted linked-list and return it. Example 1: Input: lists = [[1,4,5],[1,3,4],[2,6]] Output: [1,1,2,3,4,4,5,6] Explanation: The linked-lists are: [ 1->4->5, 1->3->4, 2->6 ] merging them into one sorted list: 1->1->2->3->4->4->5->6 . #Leetcode #Leetcode100dayschallenge #C++ #skillswallah #Day52 #consistency #DSA #leetcode150+ #PW #Skilkswallah
To view or add a comment, sign in