Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/yuvrajchandra/leetcode
This repository contains solution of Leetcode problems (in C++) and key points/takeaways/techniques involved in solving that problem.
https://github.com/yuvrajchandra/leetcode
Last synced: 2 days ago
JSON representation
This repository contains solution of Leetcode problems (in C++) and key points/takeaways/techniques involved in solving that problem.
- Host: GitHub
- URL: https://github.com/yuvrajchandra/leetcode
- Owner: Yuvrajchandra
- License: mit
- Created: 2020-10-09T15:18:41.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2020-10-30T18:54:52.000Z (about 4 years ago)
- Last Synced: 2023-10-19T23:59:36.883Z (about 1 year ago)
- Language: C++
- Size: 67.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Leetcode
This repository contains solution of Leetcode problems (in C++) and key points/takeaways/techniques involved in solving that problem.---
[1480. Running Sum of 1d Array](https://leetcode.com/problems/running-sum-of-1d-array/)
+ .size() is used to find size of vector.
For eg- int size = myVect.size();
---
[1431. Kids With the Greatest Number of Candies](https://leetcode.com/problems/kids-with-the-greatest-number-of-candies/)
+ To find max element of vector, following syntax is used.
For eg- int max = *max_element(candies.begin(),candies.end());
---[1470. Shuffle the Array](https://leetcode.com/problems/shuffle-the-array/)
+ To intialize multiple variables in for loop following syntax is used:
for(int i=0;j=0;k=0; i());
```
+ To copy a vector to another-
```
vector newVec = oldVec;
```
---[1630. Arithmetic Subarrays](https://leetcode.com/problems/arithmetic-subarrays/)
+ vec.end() points to the index equal to the size of the array.
+ To create a vector from sub-array of other array following syntax is used:
```
vector newVect(nums.begin()+1, nums.begin()+4+1);
// To copy elements of nums indexed between 1 to 4
```
Note : +1 is used with 2nd parameter due to given 1st point.---