Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
85 commits
Select commit Hold shift + click to select a range
3f0fbed
Add files via upload
Jeswindany Dec 2, 2023
19a03c0
Add files via upload
Jeswindany Dec 2, 2023
6d11917
Moving source code to December 02 file
Jeswindany Dec 2, 2023
b753907
Merge branch 'SVCE-ACM:master' into master
Jeswindany Dec 3, 2023
4db573b
Add files via upload
Jeswindany Dec 3, 2023
92e9184
Update C++_Jeswindany_Sunburnt.c++
Jeswindany Dec 3, 2023
1c63717
Merge branch 'SVCE-ACM:master' into master
Jeswindany Dec 4, 2023
f5eb534
Merge branch 'SVCE-ACM:master' into master
Jeswindany Dec 5, 2023
6177d3c
Add files via upload
Jeswindany Dec 5, 2023
e9f3b2f
Merge branch 'SVCE-ACM:master' into master
Jeswindany Dec 6, 2023
6b68645
Add files via upload
Jeswindany Dec 6, 2023
95f545b
Merge branch 'SVCE-ACM:master' into master
Jeswindany Dec 7, 2023
0053be6
Add files via upload
Jeswindany Dec 7, 2023
7f93b62
Add files via upload
Jeswindany Dec 7, 2023
7819621
Delete December 06/python3_Jeswindany_TheLostAlgorithmScrolls.py
Jeswindany Dec 7, 2023
6351135
Add files via upload
Jeswindany Dec 7, 2023
e67f5ac
Update python3_Jeswindany_TheLostAlgorithmScrolls.py
Jeswindany Dec 7, 2023
1c0f7a4
Merge branch 'SVCE-ACM:master' into master
Jeswindany Dec 8, 2023
2b72999
Add files via upload
Jeswindany Dec 8, 2023
91cd77b
Update C++_Jeswindany_TheEnchantedForest.c++
Jeswindany Dec 8, 2023
b630cdf
Update C++_Jeswindany_TheEnchantedForest.c++
Jeswindany Dec 8, 2023
51b8169
Merge branch 'SVCE-ACM:master' into master
Jeswindany Dec 9, 2023
be62b8e
Add files via upload
Jeswindany Dec 9, 2023
c94670b
Merge branch 'SVCE-ACM:master' into master
Jeswindany Dec 10, 2023
0c5f2c2
Merge branch 'SVCE-ACM:master' into master
Jeswindany Dec 11, 2023
8c2c080
Add python3_Jeswindany_CoderOfConversions.py
Jeswindany Dec 11, 2023
ccd4b80
Merge branch 'SVCE-ACM:master' into master
Jeswindany Dec 12, 2023
a797800
Add python3_Jeswindany_ForgotPassword.py
Jeswindany Dec 12, 2023
27557a3
Add C++_Jeswindany_Cricmetric.c++
Jeswindany Dec 12, 2023
0eded3c
Add python3_Jeswindany_Shoppers_Choice.py
Jeswindany Dec 12, 2023
56783ce
Add python3_Jeswindany_Shoppers_Choice.py
Jeswindany Dec 12, 2023
149e507
Add C++_Jeswindany_Sunburnt.c++
Jeswindany Dec 12, 2023
ddafdb0
Add C++_Jeswindany_Sunburnt.c++
Jeswindany Dec 12, 2023
10b2986
Add python3_Jeswindany_MirrorMagic.py
Jeswindany Dec 12, 2023
843c4bc
Add python3_Jeswindany_PeakyBlinders.py
Jeswindany Dec 12, 2023
aceb589
Add python3_Jeswindany_TheLostAlgorithmScrolls.py
Jeswindany Dec 12, 2023
aff51df
Add python3_Jeswindany_TheLostAlgorithmScrolls.py
Jeswindany Dec 12, 2023
a785930
Add C++_Jeswindany_BabyBlocks.c++
Jeswindany Dec 12, 2023
7533c64
Add C++_Jeswindany_TheEnchantedForest.c++
Jeswindany Dec 12, 2023
1788d02
Add C++_Jeswindany_camelsOnAString.c++
Jeswindany Dec 12, 2023
4de8a45
Add C++_Jeswindany_TheEnchantedForest.c++
Jeswindany Dec 12, 2023
86e088e
Add python3_Jeswindany_TheLostAlgorithmScrolls.py
Jeswindany Dec 12, 2023
257b9e2
Add C++_Jeswindany_Sunburnt.c++
Jeswindany Dec 12, 2023
eb52dd2
Add python3_Jeswindany_TheHeist.py
Jeswindany Dec 12, 2023
b8eac03
Merge branch 'SVCE-ACM:master' into master
Jeswindany Dec 13, 2023
5414c2d
Add C++_Jeswindany_CallCipher.c++
Jeswindany Dec 13, 2023
e147ab7
Add python3_Jeswindany_ForgotPassword.py
Jeswindany Dec 13, 2023
80237e7
Merge branch 'SVCE-ACM:master' into master
Jeswindany Dec 14, 2023
dcbf44d
Merge branch 'SVCE-ACM:master' into master
Jeswindany Dec 15, 2023
211957f
Merge branch 'SVCE-ACM:master' into master
Jeswindany Dec 16, 2023
819c06d
Merge branch 'SVCE-ACM:master' into master
Jeswindany Dec 17, 2023
02f2867
Merge branch 'SVCE-ACM:master' into master
Jeswindany Dec 18, 2023
aec0c89
Merge branch 'SVCE-ACM:master' into master
Jeswindany Dec 24, 2023
74b52ad
Add files via upload
Jeswindany Dec 24, 2023
eaeb7bc
Add C++_Jeswindany_GoldenRuleViolation.c++
Jeswindany Dec 24, 2023
e6b1618
Merge branch 'SVCE-ACM:master' into master
Jeswindany Dec 29, 2023
8310976
Add Python_JeswinDany_CartesianWalkValidator.py
Jeswindany Dec 29, 2023
8384074
Add C++_Jeswindany_CallOfJustice.c++
Jeswindany Dec 29, 2023
27108f6
Add files via upload
Jeswindany Dec 29, 2023
493114d
Add python3_Jeswindany_SubsequenceSorcery.py
Jeswindany Dec 29, 2023
db16a56
Add Python3_Jeswindany_OutbreakDynamics.py
Jeswindany Dec 29, 2023
0eb3218
Add C++_JeswinDany_BookshelfDilemma.c++
Jeswindany Dec 29, 2023
f407199
Add C++_Jeswindany_RiddleMeThis.c++
Jeswindany Dec 29, 2023
7252ab0
Add Python_Jeswindany_HarmonyHurdle.py
Jeswindany Dec 29, 2023
0b71b7d
Add Python_Jeswindany_HarmonyHurdle.py
Jeswindany Dec 29, 2023
b8fcdc5
Add C++_Jeswindany_ThePhantomCycle.c++
Jeswindany Dec 29, 2023
0ac2143
Add C++_Jeswindany_CircleOfEndurance.c++
Jeswindany Dec 29, 2023
5ccc5f6
Add Python_Jeswindany_TheSellingGame.py
Jeswindany Dec 31, 2023
979ee41
Add C++_Jeswindany_Cricmetric.cpp
Jeswindany Dec 31, 2023
b53d15a
Add C++_Jeswindany_Sunburnt.cpp
Jeswindany Dec 31, 2023
b0e60b9
Add C++_Jeswindany_BabyBlocks.cpp
Jeswindany Dec 31, 2023
bbcdf1b
Add C++_Jeswindany_TheEnchantedForest.cpp
Jeswindany Dec 31, 2023
c4dca0f
Add C++_Jeswindany_camelsOnAString.cpp
Jeswindany Dec 31, 2023
057f3f8
Update and rename C++_Jeswindany_CallCipher.c++ to C++_Jeswindany_Cal…
Jeswindany Dec 31, 2023
bcfa193
Add C++_Jeswindany_CallCipher.cpp
Jeswindany Dec 31, 2023
557f5bf
Add C++_Jeswindany_CallOfJustice.cpp
Jeswindany Dec 31, 2023
f3b29d9
Add C++_JeswinDany_BookshelfDilemma.cpp
Jeswindany Dec 31, 2023
41b388b
Add C++_Jeswindany_ItsChristmasSeason.cpp
Jeswindany Dec 31, 2023
089e837
Add C++_Jeswindany_SymbolicSum.cpp
Jeswindany Dec 31, 2023
38eeaee
Add Python_Jeswindany_TreasureHuntInTheIsles.py
Jeswindany Dec 31, 2023
c7173dd
Add C++_Jeswindany_RottenOranges.cpp
Jeswindany Dec 31, 2023
3817864
Add Python_Jeswindany_Dominoes.py
Jeswindany Dec 31, 2023
0be76a7
Merge branch 'SVCE-ACM:master' into master
Jeswindany Jan 1, 2024
f88eca6
Add Python_Jeswindany_NQueens.py
Jeswindany Jan 1, 2024
8c92a18
Add Python_Jeswindany_TreeInversions.py
Jeswindany Jan 1, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions December 01/C++_Jeswindany_Cricmetric.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#include <iostream>
using namespace std;

int main(){
int n;
cin >> n;
int runs[n], total = 0, highest = 0;
for (int i = 0; i<n; i++){
cin >> runs[i];
total += runs[i];
if(runs[i]>runs[highest]){
highest = i;
}
}
cout << total << endl;
cout << highest << endl;
}
8 changes: 8 additions & 0 deletions December 02/python3_Jeswindany_Shoppers_Choice.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
sales = [int(i) for i in input().split()]
visited = []
frequency = []
for i in sales:
if i not in visited:
visited.append(i)
frequency.append(sales.count(i))
print(frequency)
23 changes: 23 additions & 0 deletions December 03/C++_Jeswindany_Sunburnt.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#include <iostream>
using namespace std;
int main(){
int n;
cin >> n;
int h[n];
for(int i=0; i<n; i++){
cin >> h[i];
}
int c = 0, f;
for(int i=0; i<n; i++){
f = 1;
for(int j=0; j<i; j++){
if(h[j] >= h[i]){
f = 0;
break;
}
}
if(f == 1)
c++;
}
cout << c;
}
22 changes: 22 additions & 0 deletions December 04/python3_Jeswindany_MirrorMagic.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
def substrings(s):
substrings = []
n = len(s)

for i in range(n):
for j in range(i + 1, n + 1):
substrings.append(s[i:j])
return substrings

def palindrome(s):
return s == s[::-1]

word = input()
sub = substrings(word)
sub.sort(key = str.__len__)
for i in range(len(word), len(sub)):
if(palindrome(sub[i].casefold())):
res = sub[i]
break
else:
res = "Error"
print(res)
7 changes: 7 additions & 0 deletions December 05/python3_Jeswindany_PeakyBlinders.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
loot = [int(i) for i in input().split()]
avg = sum(loot)/len(loot)
res_sum = 0
for i in loot:
if(i>=avg):
res_sum += i
print(res_sum)
36 changes: 36 additions & 0 deletions December 06/python3_Jeswindany_TheLostAlgorithmScrolls.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
def link(a, b):
if(len(a) == len(b)):
c = 0
for i in range(len(a)):
if(a[i] != b[i]):
c+=1
if(c == 1):
return True
elif(abs(len(a) - len(b)) == 1):
if((a in b) or (b in a)):
return True
return False

words = input().split()
start = ""
res = []
for i in words:
for j in words:
if(i!=j and link(i,j)):
start = i
res.append(i)
break
if(start != ""):
break
if start == "":
print("No valid chain")
else:
while(1):
for i in words:
if(i!=start and link(start,i) and (i not in res)):
start = i
res.append(i)
break
else:
break
print(res)
18 changes: 18 additions & 0 deletions December 07/C++_Jeswindany_BabyBlocks.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#include <iostream>
#include <math.h>
using namespace std;

void rectangleInCircle(double w,double h,double r){
double diag = sqrt((w*w)+(h*h));
if(diag>(2*r))
cout << "false" << endl;
else
cout << "true" << endl;
}

int main(){
double w, h, r;
cin >> w >> h >> r;
rectangleInCircle(w,h,r);
return 0;
}
48 changes: 48 additions & 0 deletions December 08/C++_Jeswindany_TheEnchantedForest.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
#include <iostream>
#include <string.h>
using namespace std;


void find_path(int n){
int sqr[n][n];
memset(sqr, 0, sizeof(sqr));
int i = n/2;
int j = n-1;

for(int num = 1; num <= n*n;){
if(i == -1 && j == n){
i = 0;
j = n-2;
}
else{
if(j == n)
j = 0;
if(i < 0)
i = n-1;
}
if(sqr[i][j]){
i += 1;
j -= 2;
continue;
}
else{
sqr[i][j] = num++;
}
i--;
j++;
}

for (i = 0; i<n; i++){
for(j = 0;j<n; j++){
cout << sqr[i][j] << " ";
}
cout << endl;
}
}

int main(){
int n;
cin >> n;
find_path(n);
return 0;
}
16 changes: 16 additions & 0 deletions December 09/C++_Jeswindany_camelsOnAString.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#include <string.h>
#include <iostream>
using namespace std;

int main(){
string text;
cin >> text;
int c = 1;
for(int i = 0; i<text.length(); i++){
if(text[i] >=65 && text[i] <= 90){
c += 1;
}
}
cout << c;
return 0;
}
12 changes: 12 additions & 0 deletions December 10/python3_Jeswindany_ForgotPassword.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import re

def substring(name, a, b):
return name[a-1:a+b-1]

data = [[100, "Shivnash Kumar"],[110,"Ragul Gupta"]]

ind = re.findall('\d+',input())
a,b= [int(i) for i in ind]

for i,j in data:
print(substring(j,a,b))
5 changes: 5 additions & 0 deletions December 11/python3_Jeswindany_CoderOfConversions.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
def binsum(a,b):
return bin(a+b)[2:]

a,b = [int(i) for i in input().split()]
print(binsum(a,b))
25 changes: 25 additions & 0 deletions December 12/python3_Jeswindany_TheHeist.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
def binarySearch(box):
l = 0
h = len(box) - 1
while(l <= h):
m = (l+h)//2
if(box[m].lower() == "gold"):
return 1
elif(box[m].lower() < "gold"):
l = m+1
elif(box[m].lower() > "gold"):
h = m-1
return 0

box1 = sorted([i.lower() for i in input().split()])
box2 = sorted([i.lower() for i in input().split()])
box3 = sorted([i.lower() for i in input().split()])

if(binarySearch(box1)):
print("Box1 Contains the Gold")
elif(binarySearch(box2)):
print("Box2 Contains the Gold")
elif(binarySearch(box3)):
print("Box3 Contains the Gold")
else:
print("Gold not Found")
57 changes: 57 additions & 0 deletions December 13/C++_Jeswindany_CallCipher.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
#include <string.h>
#include <iostream>
using namespace std;

int textToNum(char c){
switch(c){
case 65:
case 66:
case 67:
return 2;
case 68:
case 69:
case 70:
return 3;
case 71:
case 72:
case 73:
return 4;
case 74:
case 75:
case 76:
return 5;
case 77:
case 78:
case 79:
return 6;
case 80:
case 81:
case 82:
case 83:
return 7;
case 84:
case 85:
case 86:
return 8;
case 87:
case 88:
case 89:
case 90:
return 9;
}
}

int main(){
string S;
cin >> S;
for (char i: S){
if(i>=65 && i<=90)
cout << textToNum(i);
else if(i>=97 && i<=122)
cout << textToNum(toupper(i));
else
cout << i;
}
cout << endl;
return 0;
}
74 changes: 74 additions & 0 deletions December 14/C++_Jeswindany_CallOfJustice.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;

class TreeNode {
public:
int value;
TreeNode* left;
TreeNode* right;

TreeNode(int val) : value(val), left(nullptr), right(nullptr) {}
};
void findKDistanceNodes(TreeNode* root, int target, int k, vector<int>& result) {
if (!root)
return;

if (k == 0) {
result.push_back(root->value);
return;
}

findKDistanceNodes(root->left, target, k - 1, result);
findKDistanceNodes(root->right, target, k - 1, result);
}

int findTarget(TreeNode* root, int target, int k, vector<int>& result) {
if (!root)
return -1;

if (root->value == target) {
findKDistanceNodes(root, target, k, result);
return 0;
}

int leftDistance = findTarget(root->left, target, k, result);
if (leftDistance >= 0) {
if (leftDistance + 1 == k)
result.push_back(root->value);

findKDistanceNodes(root->right, target, k - leftDistance - 2, result);
return leftDistance + 1;
}

int rightDistance = findTarget(root->right, target, k, result);
if (rightDistance >= 0) {
if (rightDistance + 1 == k)
result.push_back(root->value);

findKDistanceNodes(root->left, target, k - rightDistance - 2, result);
return rightDistance + 1;
}
return -1;
}

int main() {
TreeNode* root = new TreeNode(17);
root->left = new TreeNode(8);
root->right = new TreeNode(27);
root->left->left = new TreeNode(4);
root->left->right = new TreeNode(14);
root->left->right->left = new TreeNode(10);
root->left->right->right = new TreeNode(16);
int targetNode = 8;
int kDistance = 2;
vector<int> output;
findTarget(root, targetNode, kDistance, output);
sort(output.begin(),output.end());
for (int node : output) {
cout << node << " ";
}
cout << endl;
return 0;
}
13 changes: 13 additions & 0 deletions December 15/python3_Jeswindany_SubsequenceSorcery.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
def subsequence(s, sub, substr = ""):
if(len(s) == 0):
sub.append(substr)
return
subsequence(s[:-1], sub, substr + s[-1])
subsequence(s[:-1], sub, substr)
return

s = input()
sub = []
subsequence(s, sub)

print(len(set(sub)))
Loading