Dashboard Temp Share Shortlinks Frames API

cody - HTMLify profile

files of /cody/pratham0709/Striver-A-TO-Z-SDE-SHEET/Array/Easy/

Check if array is sorted.cpp /cody/pratham0709/Striver-A-TO-Z-SDE-SHEET/Array/Easy/Check if array is sorted.cpp
31 Views
0 Comments
class Solution {
public:
bool arraySortedOrNot(int arr[], int n) {
for(int i=0;i<n-1;i++){
if(arr[
Complete Sum.cpp(CN) /cody/pratham0709/Striver-A-TO-Z-SDE-SHEET/Array/Easy/Complete Sum.cpp(CN)
12 Views
0 Comments
#include <bits/stdc++.h>
vector<int> completeSum(vector<int> &a, int n) {
// Write your code here.
int i =0;
vector
Find the element that appears once.cpp /cody/pratham0709/Striver-A-TO-Z-SDE-SHEET/Array/Easy/Find the element that appears once.cpp
26 Views
0 Comments
class Solution{
public:
int search(int A[], int N){
//code
int xor1 = 0;
for(int i=0 ;i<N; i++){
xo
Largest Element in Array.cpp /cody/pratham0709/Striver-A-TO-Z-SDE-SHEET/Array/Easy/Largest Element in Array.cpp
13 Views
0 Comments
class Solution
{
public:
int largest(vector<int> &arr, int n)
{
int large = arr[0];

for(
Left Rotate an array by one place.cpp /cody/pratham0709/Striver-A-TO-Z-SDE-SHEET/Array/Easy/Left Rotate an array by one place.cpp
13 Views
0 Comments
class Solution{


public:
void leftRotate(int arr[], int k, int n)
{
// Your code goes here
k = k % n;
Linear Search.cpp /cody/pratham0709/Striver-A-TO-Z-SDE-SHEET/Array/Easy/Linear Search.cpp
13 Views
0 Comments
int linearSearch(int n, int num, vector<int> &arr)
{
// Write your code here.
for(int i =0; i<n; i++){
if(ar
Majority Element - II.cpp(CN) /cody/pratham0709/Striver-A-TO-Z-SDE-SHEET/Array/Easy/Majority Element - II.cpp(CN)
8 Views
0 Comments
#include <bits/stdc++.h>

vector<int> majorityElementII(vector<int> &arr)
{
// Write your code here.
map<int, int>mpp;

Max Consecutive Ones.cpp /cody/pratham0709/Striver-A-TO-Z-SDE-SHEET/Array/Easy/Max Consecutive Ones.cpp
13 Views
0 Comments
class Solution {
public:
int findMaxConsecutiveOnes(vector<int>& nums) {
int ans = 0;
int temp = 0;

Merge Sorted Array(LC).cpp /cody/pratham0709/Striver-A-TO-Z-SDE-SHEET/Array/Easy/Merge Sorted Array(LC).cpp
15 Views
0 Comments
for (int j = 0, i = m; j<n; j++){
nums1[i] = nums2[j];
i++;
}
sort(nums1.begin(),nums1.e
Missing number.cpp /cody/pratham0709/Striver-A-TO-Z-SDE-SHEET/Array/Easy/Missing number.cpp
10 Views
0 Comments
int missingNumber(int A[], int N)
{
// Your code goes here
int xor1 = 0;
int xor2 = 0;

for(int i=0; i
Move Zeros To Left /cody/pratham0709/Striver-A-TO-Z-SDE-SHEET/Array/Easy/Move Zeros To Left
8 Views
0 Comments
#include <bits/stdc++.h>
void moveZerosToLeft(int *arr, int n)
{

int i=n-1;
for(int j=n-1;j>=0;j--){

Move all zeroes to end of array.cpp /cody/pratham0709/Striver-A-TO-Z-SDE-SHEET/Array/Easy/Move all zeroes to end of array.cpp
12 Views
0 Comments
#include <bits/stdc++.h>
using namespace std;

vector<int> moveZeros(int n, vector<int> a) {
int j = -1;
//place th
Non-Repeating Element.cpp /cody/pratham0709/Striver-A-TO-Z-SDE-SHEET/Array/Easy/Non-Repeating Element.cpp
16 Views
0 Comments
class Solution{
public:
int firstNonRepeating(int arr[], int n)
{
// Complete the function
map<int
One Iteration.cpp(CN) /cody/pratham0709/Striver-A-TO-Z-SDE-SHEET/Array/Easy/One Iteration.cpp(CN)
26 Views
0 Comments
#include <bits/stdc++.h>
int oneIteration(vector<int> A)
{
// Write your code here.
int n = A.size();
int largest
Remove duplicate elements from sorted Array.cpp /cody/pratham0709/Striver-A-TO-Z-SDE-SHEET/Array/Easy/Remove duplicate elements from sorted Array.cpp
17 Views
0 Comments
class Solution{
public:
int remove_duplicate(int a[],int n){
// code here
int i = 0;
for(int j
Rotate array.cpp /cody/pratham0709/Striver-A-TO-Z-SDE-SHEET/Array/Easy/Rotate array.cpp
31 Views
0 Comments
class Solution {
public:
void rotate(vector<int>& nums, int k) {

// Brute Force Approch{
// k = k % nu
Second Largest.cpp /cody/pratham0709/Striver-A-TO-Z-SDE-SHEET/Array/Easy/Second Largest.cpp
27 Views
0 Comments
class Solution{
public:
// Function returns the second
int secondlargest(int arr[], int n){
int largest = arr[0];

Sort An Array of 0s, 1s and 2s.cpp(CN) /cody/pratham0709/Striver-A-TO-Z-SDE-SHEET/Array/Easy/Sort An Array of 0s, 1s and 2s.cpp(CN)
25 Views
0 Comments
#include <bits/stdc++.h>
void sortArray(vector<int>& arr, int n)
{
// Write your code here
sort(arr.begin(), arr.end())