Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
67ffe08
add December 1 - Cricmetric
Abhijeet-Dutta-10 Jan 14, 2024
a850642
add December 2 - Shopper's Choice
Abhijeet-Dutta-10 Jan 14, 2024
6820fa9
add December 1 - Cricmetric
Abhijeet-Dutta-10 Jan 14, 2024
973d54d
Rename c++_Abhijeet-Dutta-10 to c++_Abhijeet-Dutta-10.cpp
Abhijeet-Dutta-10 Jan 14, 2024
c4da683
add December 1 - Cricmetric
Abhijeet-Dutta-10 Jan 14, 2024
5a33d75
add December 3 - Sunburnt
Abhijeet-Dutta-10 Jan 14, 2024
57bc4cd
add December 4 - Mirror Magic
Abhijeet-Dutta-10 Jan 14, 2024
a8b390d
add December 5 - Peaky Blinders
Abhijeet-Dutta-10 Jan 14, 2024
75424a1
add December 6 - The Lost Algorithm Scrolls
Abhijeet-Dutta-10 Jan 14, 2024
4b0e8e3
add December 7 - Baby Blocks
Abhijeet-Dutta-10 Jan 14, 2024
4fe4886
add December 8 - The Enchanted Forest
Abhijeet-Dutta-10 Jan 14, 2024
fdd369c
add December 9 - Camels on a String!
Abhijeet-Dutta-10 Jan 14, 2024
c28ad73
add December 10 - Forgot Password.
Abhijeet-Dutta-10 Jan 14, 2024
7acea55
add December 11 - Coder of Conversions
Abhijeet-Dutta-10 Jan 14, 2024
43051fd
add December 12 - The Heist
Abhijeet-Dutta-10 Jan 14, 2024
f255315
add December 13 - Call Cipher
Abhijeet-Dutta-10 Jan 14, 2024
0ae6590
add December 14 - Call of Justice
Abhijeet-Dutta-10 Jan 14, 2024
cb2ab28
add December 15 - Subsequence Sorcery
Abhijeet-Dutta-10 Jan 14, 2024
e572feb
add December 16 - Outbreak Dynamics
Abhijeet-Dutta-10 Jan 14, 2024
084c72a
add December 17 - Bookshelf Dilemma
Abhijeet-Dutta-10 Jan 14, 2024
b54b452
add December 18 - It's Christmas Season
Abhijeet-Dutta-10 Jan 14, 2024
559fc83
add December 19 - Symbolic Sum
Abhijeet-Dutta-10 Jan 14, 2024
7f46355
add December 20 - Treasure Hunt In The Isles
Abhijeet-Dutta-10 Jan 14, 2024
75a9eef
add December 21 - Riddle Me This
Abhijeet-Dutta-10 Jan 14, 2024
1531a58
add December 22 - Rotten Oranges
Abhijeet-Dutta-10 Jan 14, 2024
a85421c
add December 23 - Dominoes
Abhijeet-Dutta-10 Jan 14, 2024
5077289
add December 24 - Golden Rule Violation
Abhijeet-Dutta-10 Jan 14, 2024
af1e3fc
add December 25 - Harmony Hurdle
Abhijeet-Dutta-10 Jan 14, 2024
2548025
add December 26 - The Phantom Cycle
Abhijeet-Dutta-10 Jan 14, 2024
fd76371
add December 27 - Circle of Endurance
Abhijeet-Dutta-10 Jan 14, 2024
7de8780
add December 28 - The Selling Game
Abhijeet-Dutta-10 Jan 14, 2024
8c7db80
add December 29 - Cartesian Walk Validator
Abhijeet-Dutta-10 Jan 14, 2024
d7dce16
add December 30 - Tree Inversions
Abhijeet-Dutta-10 Jan 14, 2024
0c2d2e8
add December 31 - N Queens
Abhijeet-Dutta-10 Jan 14, 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
18 changes: 18 additions & 0 deletions December 01/c++_Abhijeet-Dutta-10.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#include <bits/stdc++.h>
using namespace std;

int main()
{
int n, total = 0, a, maxi = 0, pos;
cin >> n;
for(int i = 0; i<n; i++){
cin >> a;
total += a;
if(maxi < a){
pos = i;
maxi = a;
}
}
cout << total << endl << pos;
return 0;
}
35 changes: 35 additions & 0 deletions December 02/c++_Abhijeet-Dutta-10.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#include <bits/stdc++.h>
using namespace std;

vector<int> v;
unordered_map<int, int> filter(string s){
int temp = 0;
unordered_map<int, int> mp;
for(int i = 1; i<s.size(); i++){
if(s[i] >= '0' && s[i] <= '9'){
temp = (temp*10)+int(s[i] - '0');
} else {
mp[temp]++;
if(!count(v.begin(), v.end(), temp)) v.push_back(temp);
temp = 0;
}
}
return mp;
}

int main()
{
string s;
cin >> s;
unordered_map<int, int> mp = filter(s);
cout << '[';
for(int i = 0; i < v.size(); i++){
if(i == v.size()-1){
cout << mp[v[i]];
break;
}
cout << mp[v[i]] << ',';
}
cout << "]";
return 0;
}
18 changes: 18 additions & 0 deletions December 03/c++_Abhijeet-Dutta-10.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#include <bits/stdc++.h>
using namespace std;

int main()
{
int n;
cin >> n;
int maxi = 0, a, ans = 0;
for(int i =0; i<n; i++){
cin >> a;
if(maxi < a){
maxi = a;
ans++;
}
}
cout << ans;
return 0;
}
26 changes: 26 additions & 0 deletions December 04/c++_Abhijeet-Dutta-10.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#include <bits/stdc++.h>
using namespace std;

int main()
{
string s;
cin >> s;
char temp = s[0];
string ans = "";
transform(s.begin(), s.end(), s.begin(), ::tolower);
for(int i = 1; i< s.size(); i++){
if(s[i] == temp){
cout << s[i] << s[i];
exit(0);
}
temp = s[i];
}
for(int i=1; i<s.size()-1; i++){
if(s[i-1] == s[i+1]){
cout << s[i-1] << s[i] << s[i-1];
exit(0);
}
}
cout << "Error";
return 0;
}
20 changes: 20 additions & 0 deletions December 05/c++_Abhijeet-Dutta-10.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#include <bits/stdc++.h>
using namespace std;

int main(){
int ans = 0, n, total = 0;
cin >> n;
vector<int> v;
for(int i = 0; i<n; i++){
int a;
cin >> a;
v.push_back(a);
total += a;
}
int avg = total/n;
for(auto i : v){
if(i >= avg) ans += i;
}
cout << ans;
return 0;
}
35 changes: 35 additions & 0 deletions December 06/c++_Abhijeet-Dutta-10.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#include <bits/stdc++.h>
using namespace std;

int main()
{
int n;
cin >> n;
vector<string> v;
for(int i = 0; i<n; i++){
string s;
cin >> s;
v.push_back(s);
}
vector<string> ans;
ans.push_back(v[0]);
for(int i = 1; i<n; i++){
int s1 = v[i].size();
int s2 = v[i-1].size();
if(abs(s1-s2) > 1) break;
int temp = 0;
if(abs(s1-s2) == 1) temp++;
for(int j = 0; j<min(v[i].size(), v[i-1].size()); j++){
if(v[i][j] != v[i-1][j]) temp++;
}
if(temp <= 1) ans.push_back(v[i]);
else break;
}
if(ans.size() == 1) cout << "No valid chain.";
else{
for(auto i: ans){
cout << i << " ";
}
}
return 0;
}
18 changes: 18 additions & 0 deletions December 07/c++_Abhijeet-Dutta-10.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#include <bits/stdc++.h>
using namespace std;

bool rectangleInCircle(float h, float b, float r){
float d = sqrt(pow(h,2)+pow(b,2));
if(d == 2*r) return true;
return false;
}

int main()
{
float h,b,r;
cout<< "Enter the height, breadth of rectangle and radius of circle: ";
cin >> h >> b >> r;
if(rectangleInCircle(h, b, r)) cout << "true";
else cout << "false";
return 0;
}
28 changes: 28 additions & 0 deletions December 08/c++_Abhijeet-Dutta-10.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#include <bits/stdc++.h>
using namespace std;

int main() {
int n;
cin >> n;
vector<vector<int>> square(n, vector<int>(n, -1));
int x = (n / 2), y = n - 1;
for(int i=1; i<=n*n; i++) {
square[x][y] = i;
if(i % n == 0) y--;
else {
x--;
y++;
}
x += n;
x %= n;
y += n;
y %= n;
}
for(auto i : square) {
for(auto j : i) {
cout<< j << " ";
}
cout<< endl;
}
return 0;
}
14 changes: 14 additions & 0 deletions December 09/c++_Abhijeet-Dutta-10.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#include <bits/stdc++.h>
using namespace std;

int main()
{
string s;
cin >> s;
int ans = 0;
for(int i = 0; i<s.size(); i++){
if(s[i] >= 'A' && s[i] <= 'Z') ans++;
}
cout << ans;
return 0;
}
10 changes: 10 additions & 0 deletions December 10/sql_Abhijeet-Dutta-10.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
create database e;
use e;
CREATE table emp (
empno int PRIMARY KEY,
empname varchar(50)
);
INSERT INTO emp VALUES (1, 'December');
INSERT INTO emp VALUES (2, 'Algorithm');
SELECT substring(empname,4,13) from emp;
SELECT substring(empname,2,2) from emp;
11 changes: 11 additions & 0 deletions December 11/c++_Abhijeet-Dutta-10.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#include <bits/stdc++.h>
using namespace std;

int main()
{
int n1, n2;
cout << "Enter the two numbers: ";
cin >> n1 >> n2;
cout << bitset<8>(n1+n2).to_string();
return 0;
}
35 changes: 35 additions & 0 deletions December 12/c++_Abhijeet-Dutta-10.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#include <bits/stdc++.h>
using namespace std;

int main()
{
vector<pair<string, int>> box;
for(int i = 0; i<3; i++){
cout << "Enter the No. of jewelry for Box" << i+1 << " :";
int n;
cin >> n;
cout << "Enter the jewelry for Box" << i+1 << " :";
for(int j = 0; j<n; j++){
string s;
cin >> s;
transform(s.begin(), s.end(), s.begin(), ::tolower);
box.push_back(make_pair(s, i+1));
}
}
sort(box.begin(), box.end());
int l = 0, h = box.size()-1;
while(l <= h){
int m = (l+h)/2;
if(box[m].first == "gold"){
cout << "Box" << box[m].second << " Contains the Gold";
exit(0);
}
if(box[m].first > "gold"){
h = m-1;
} else {
l = m+1;
}
}
cout << "Gold is not present";
return 0;
}
24 changes: 24 additions & 0 deletions December 13/c++_Abhijeet-Dutta-10.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#include <bits/stdc++.h>
using namespace std;

string textToNum(string s){
for(int i = 0; i<s.size(); i++){
if(s[i] >= 'A' && s[i] <= 'C') s[i] = '2';
else if(s[i] >= 'D' && s[i] <= 'F') s[i] = '3';
else if(s[i] >= 'G' && s[i] <= 'I') s[i] = '4';
else if(s[i] >= 'J' && s[i] <= 'L') s[i] = '5';
else if(s[i] >= 'M' && s[i] <= 'O') s[i] = '6';
else if(s[i] >= 'P' && s[i] <= 'S') s[i] = '7';
else if(s[i] >= 'T' && s[i] <= 'V') s[i] = '8';
else if(s[i] >= 'W' && s[i] <= 'Z') s[i] = '9';
}
return s;
}

int main()
{
string s;
cin >> s;
cout << textToNum(s);
return 0;
}
Loading