1470 Shuffle the Array | Zero to FAANG Kunal | Assignment Solution | Leetcode
1470 Shuffle the Array | Zero to FAANG Kunal | Assignment Solution | Leetcode | Shapnesh Problem link : https://leetcode.com/problems/shuffle-the-array/ Course link: https://github.com/kunal-kushwaha/DSA-Bootcamp-Java Complete Java + DSA + Interview Preparation + CP Course https://youtube.com/playlist?list=PL9gnSGHSqcnr_DxHsP7AW9ftq0AtAyYqJ Hi, thanks for watching our video about Arrays in Java In this video we’ll walk you through: - Brute Force - Efficient approach - Solution Code TIMESTAMPS 00:00 Intro 00:17 Explanation begins 03:17 Bruteforce Approach 11:42 Optimized Approach 25:18 Using Bitwise Operators IDE solution ABOUT OUR CHANNEL Our channel is all about Programming. We cover lots of cool stuff such as solution to problems, concept explanation and tricks to master CP Check out our channel here: https://www.youtube.com/channel/UCqtYay7YwH8JdZxDqpVEPvg Don’t forget to subscribe! CHECK OUT OUR OTHER Playlists GeeksforGeeks playlist: https://youtube.com/playlist?list=PLDaU_TBYXoirv-848r81oHLSArcBrjIe7 Complete C++ Course playlist: https://youtube.com/playlist?list=PLDaU_TBYXoio9L1qRpTrtzK9JJAwFLMSj CodeChef Playlist: https://youtube.com/playlist?list=PLDaU_TBYXoip_JFIo0U-Nl2dNA_ZMsd2z HackerRank playlist: https://youtube.com/playlist?list=PLDaU_TBYXoirMjgzW59T_XMyT5yRZ7ht_ LeetCode problems https://youtube.com/playlist?list=PLDaU_TBYXoirsirbg6feNCKk3oPRn6M7w FIND US AT https://www.waadanibhao.wordpress.com GET IN TOUCH Contact us on [email protected] 1470. Shuffle the Array Easy Given the array nums consisting of 2n elements in the form [x1,x2,...,xn,y1,y2,...,yn]. Return the array in the form [x1,y1,x2,y2,...,xn,yn]. Example 1: Input: nums = [2,5,1,3,4,7], n = 3 Output: [2,3,5,4,1,7] Explanation: Since x1=2, x2=5, x3=1, y1=3, y2=4, y3=7 then the answer is [2,3,5,4,1,7]. Example 2: Input: nums = [1,2,3,4,4,3,2,1], n = 4 Output: [1,4,2,3,3,2,4,1] Example 3: Input: nums = [1,1,2,2], n = 2 Output: [1,2,1,2] Constraints: 1 = n = 500 nums.length == 2n 1 = nums[i] = 10^3 Accepted 243,471 Submissions 276,438
Download
0 formatsNo download links available.