Rotate and delete | GeeksForGeeks | Problem of the Day

  Рет қаралды 275

Mathematics

Mathematics

Күн бұрын

Пікірлер: 3
@mathematics3398
@mathematics3398 8 күн бұрын
Table of Contents 0:00 Problem Statement 0:47 Solution 5:40 Pseudo Code 7:40 Code - Python 8:13 Code - C++
@mathematics3398
@mathematics3398 8 күн бұрын
class Solution: def rotateDelete(self, arr): n = len(arr) i = 1 while i < (n//2) + 1: arr.insert(0, arr.pop()) arr.pop(-i) #print(f"{arr} and i={i}") i += 1 return arr[0]
@mathematics3398
@mathematics3398 8 күн бұрын
class Solution { public: int rotateDelete(vector &arr) { int i = 1; int n = arr.size(); while (i < (n/2) + 1) { rotate(arr.begin(), arr.end() - 1, arr.end()); arr.erase(arr.begin() + arr.size() - i); i++; } return arr[0]; } };
Minimal Cost | GeeksForGeeks | Problem of the Day
13:54
Mathematics
Рет қаралды 338
Synyptas 4 | Жігіттер сынып қалды| 3 Bolim
19:27
Когда отец одевает ребёнка @JaySharon
00:16
История одного вокалиста
Рет қаралды 11 МЛН
小蚂蚁会选到什么呢!#火影忍者 #佐助 #家庭
00:47
火影忍者一家
Рет қаралды 38 МЛН
WHY IS THE HEAP SO SLOW?
17:53
Core Dumped
Рет қаралды 233 М.
Majority Vote | GeeksForGeeks | Problem of the Day
13:22
Mathematics
Рет қаралды 66
Dynamic Programming isn't too hard. You just don't know what it is.
22:31
DecodingIntuition
Рет қаралды 170 М.
Being Competent With Coding Is More Fun
11:13
TheVimeagen
Рет қаралды 92 М.
How Fast Can I Fill My Inbox?
13:30
Dev Detour
Рет қаралды 332 М.
LeetCode was HARD until I Learned these 15 Patterns
13:00
Ashish Pratap Singh
Рет қаралды 427 М.
Just enough assembly to blow your mind
29:31
Kay Lack
Рет қаралды 89 М.
Synyptas 4 | Жігіттер сынып қалды| 3 Bolim
19:27