Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit2bd465c

Browse files
authored
Merge pull request#254 from coder2hacker/main
bhava request accept kr
2 parents2b28ff2 +5061fbf commit2bd465c

File tree

199 files changed

+15451
-90
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

199 files changed

+15451
-90
lines changed

‎07 check_subset.cpp‎

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
#include<iostream>
2+
#include<cstring>
3+
usingnamespacestd;
4+
5+
boolisSubset(string s1,string s2){
6+
7+
int i = s1.length() -1;
8+
int j = s2.length()-1;
9+
10+
while(i>=0and j>=0){
11+
if(s2[j]==s1[i]){
12+
i--;
13+
j--;
14+
}
15+
else{
16+
i--;
17+
}
18+
}
19+
if(j==-1){
20+
returntrue;
21+
}
22+
returnfalse;
23+
24+
}
25+
26+
27+
intmain() {
28+
string s1,s2;
29+
cin>>s1>>s2;
30+
cout<<isSubset(s1,s2) <<endl;
31+
32+
}

‎AdityaMandage.json‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"github_username":"AdityaMandage",
3+
"favourite_programming_language":"Python",
4+
"dream_company":"Microsoft",
5+
"favourite_os":"Ubuntu"
6+
}

‎Amazon - LeetCode.pdf‎

697 KB
Binary file not shown.

‎Anmol's Resume.pdf‎

71.3 KB
Binary file not shown.

‎Armstrongnumber.py‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#python program to find arm strong number
2+
3+
num=int(input("enter the number:"))
4+
temp=str(num)
5+
num_len=len(temp)
6+
arr= []
7+
foriintemp:
8+
arr.append(int(i)**num_len)
9+
ifnum==sum(arr):
10+
print("arm strong")
11+
else:
12+
print("not arm strong")

‎ArraySumStream.java‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
importjava.util.Arrays;
2+
3+
publicclassArraySumStream {
4+
5+
publicstaticvoidmain(String[]args) {
6+
int[]array = {10,20,30};
7+
intsum =Arrays.stream(array).reduce(Integer::sum).getAsInt();
8+
System.out.println(sum);
9+
10+
Arrays.stream(array).reduce(Integer::sum).ifPresent(System.out::println);
11+
}
12+
}

‎Array_2D.java‎

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
2+
publicclassArray_2D {
3+
4+
publicstaticvoidmain(String[]args) {
5+
6+
int[][]x=newint [3][3];
7+
int[][]y = { {1,2,3}, {4,5,6}, {7,8,9}};
8+
for(introw=0;row<3;row++)
9+
{
10+
for(intcol=0;col<3;col++)
11+
{
12+
System.out.print(x[row][col]+" ");
13+
}
14+
System.out.println();
15+
}
16+
17+
System.out.println("\n");
18+
for(introw=0;row<3;row++)
19+
{
20+
for(intcol=0;col<3;col++)
21+
{
22+
System.out.print(y[row][col]+" ");
23+
}
24+
System.out.println();
25+
}
26+
27+
28+
}
29+
30+
}

‎BST.cpp‎

Lines changed: 146 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,146 @@
1+
#include<iostream>
2+
#include<queue>
3+
usingnamespacestd;
4+
5+
classnode{
6+
public:
7+
int data;
8+
node* left;
9+
node*right;
10+
node(int d)
11+
{
12+
data=d;
13+
left=NULL;
14+
right=NULL;
15+
}
16+
};
17+
18+
node*buildTree(node* root) {
19+
20+
cout <<"Enter the data:" << endl;
21+
int data;
22+
cin >> data;
23+
root =newnode(data);
24+
25+
if(data == -1) {
26+
returnNULL;
27+
}
28+
29+
cout <<"Enter data for inserting in left of" << data << endl;
30+
root->left =buildTree(root->left);
31+
cout <<"Enter data for inserting in right of" << data << endl;
32+
root->right =buildTree(root->right);
33+
return root;
34+
35+
}
36+
37+
voidlevelOrderTraversal(node* root) {
38+
queue<node*> q;
39+
q.push(root);
40+
q.push(NULL);
41+
42+
while(!q.empty()) {
43+
node* temp = q.front();
44+
q.pop();
45+
46+
if(temp ==NULL) {
47+
//purana level complete traverse ho chuka hai
48+
cout << endl;
49+
if(!q.empty()) {
50+
//queue still has some child ndoes
51+
q.push(NULL);
52+
}
53+
}
54+
else{
55+
cout << temp -> data <<"";
56+
if(temp ->left) {
57+
q.push(temp ->left);
58+
}
59+
60+
if(temp ->right) {
61+
q.push(temp ->right);
62+
}
63+
}
64+
}
65+
}
66+
67+
voidinOrder(node* root)
68+
{
69+
if(root==NULL)
70+
{
71+
return;
72+
}
73+
inOrder(root->left);
74+
cout<< root->data <<"";
75+
inOrder(root->right);
76+
}
77+
78+
voidpreOrder(node* root)
79+
{
80+
if(root==NULL)
81+
{
82+
return;
83+
}
84+
cout<< root->data <<"";
85+
preOrder(root->left);
86+
preOrder(root->right);
87+
}
88+
89+
voidpostorder(node* root) {
90+
//base case
91+
if(root ==NULL) {
92+
return ;
93+
}
94+
95+
postorder(root->left);
96+
postorder(root->right);
97+
cout << root-> data <<"";
98+
99+
}
100+
voidbuildfromOrderLevel(node* &root)
101+
{
102+
queue<node*>q;
103+
cout<<"Enter data for root"<<endl;
104+
int data;
105+
cin>>data;
106+
root=newnode(data);
107+
q.push(root);
108+
while(!q.empty())
109+
{
110+
node* temp=q.front();
111+
q.pop();
112+
cout<<"Enter left node for"<<temp->data<<endl;
113+
int leftData;
114+
cin>>leftData;
115+
if(leftData!=-1)
116+
{
117+
temp->left=newnode(leftData);
118+
q.push(temp->left);
119+
}
120+
cout<<"Enter right node for"<<temp->data<<endl;
121+
int rightData;
122+
cin>>rightData;
123+
if(rightData!=-1)
124+
{
125+
temp->right=newnode(rightData);
126+
q.push(temp->right);
127+
}
128+
}
129+
}
130+
intmain()
131+
{
132+
node* root=NULL;
133+
buildfromOrderLevel(root);
134+
levelOrderTraversal(root);
135+
/*cout<<"....Creating a tree...."<<endl;
136+
root=buildTree(root);*/
137+
cout <<"Printing the level order tracersal output" << endl;
138+
levelOrderTraversal(root);
139+
cout <<"inorder traversal is:";
140+
inOrder(root);
141+
cout << endl <<"preorder traversal is:";
142+
preOrder(root);
143+
cout << endl <<"postorder traversal is:";
144+
postorder(root);
145+
return0;
146+
}

‎Binary_to_Decimal.cpp‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@ int main(void)
1515
string binary;
1616
cout <<"Enter a binary number:";
1717
cin >> binary;
18-
cout <<"Thedecimal representation ofbinary number" << binary <<" is" <<bintodec(binary) << endl;
18+
cout <<"TheDecimal Representation ofthe Binary Number" << binary <<" is" <<bintodec(binary) << endl;
1919
return0;
20-
}
20+
}

‎BlindDSASheet‎

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
Hi folks,
2+
3+
I found a list of Blind 75 Leetcode problems. Sharing it as I found it very useful.
4+
5+
Happy Coding!
6+
7+
Array
8+
Two Sum
9+
Best Time to Buy and Sell Stock
10+
Contains Duplicate
11+
Product of Array Except Self
12+
Maximum Subarray
13+
Maximum Product Subarray
14+
Find Minimum in Rotated Sorted Array
15+
Search in Rotated Sorted Array
16+
3 Sum
17+
Container With Most Water
18+
Binary
19+
Sum of Two Integers
20+
Number of 1 Bits
21+
Counting Bits
22+
Missing Number
23+
Reverse Bits
24+
Dynamic Programming
25+
Climbing Stairs
26+
Coin Change
27+
Longest Increasing Subsequence
28+
Longest Common Subsequence
29+
Word Break Problem
30+
Combination Sum
31+
House Robber
32+
House Robber II
33+
Decode Ways
34+
Unique Paths
35+
Jump Game
36+
Graph
37+
Clone Graph
38+
Course Schedule
39+
Pacific Atlantic Water Flow
40+
Number of Islands
41+
Longest Consecutive Sequence
42+
Alien Dictionary (Leetcode Premium)
43+
Graph Valid Tree (Leetcode Premium)
44+
Number of Connected Components in an Undirected Graph (Leetcode Premium)
45+
Interval
46+
Insert Interval
47+
Merge Intervals
48+
Non-overlapping Intervals
49+
Meeting Rooms (Leetcode Premium)
50+
Meeting Rooms II (Leetcode Premium)
51+
Linked List
52+
Reverse a Linked List
53+
Detect Cycle in a Linked List
54+
Merge Two Sorted Lists
55+
Merge K Sorted Lists
56+
Remove Nth Node From End Of List
57+
Reorder List
58+
Matrix
59+
Set Matrix Zeroes
60+
Spiral Matrix
61+
Rotate Image
62+
Word Search
63+
String
64+
Longest Substring Without Repeating Characters
65+
Longest Repeating Character Replacement
66+
Minimum Window Substring
67+
Valid Anagram
68+
Group Anagrams
69+
Valid Parentheses
70+
Valid Palindrome
71+
Longest Palindromic Substring
72+
Palindromic Substrings
73+
Encode and Decode Strings (Leetcode Premium)
74+
Tree
75+
Maximum Depth of Binary Tree
76+
Same Tree
77+
Invert/Flip Binary Tree
78+
Binary Tree Maximum Path Sum
79+
Binary Tree Level Order Traversal
80+
Serialize and Deserialize Binary Tree
81+
Subtree of Another Tree
82+
Construct Binary Tree from Preorder and Inorder Traversal
83+
Validate Binary Search Tree
84+
Kth Smallest Element in a BST
85+
Lowest Common Ancestor of BST
86+
Implement Trie (Prefix Tree)
87+
Add and Search Word
88+
Word Search II
89+
Heap
90+
Merge K Sorted Lists
91+
Top K Frequent Elements
92+
Find Median from Data Stream

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp