Skip to content

Commit aa2b3bd

Browse files
Mohit JainMohit Jain
authored andcommitted
push latest code
1 parent 984a167 commit aa2b3bd

File tree

13 files changed

+240
-0
lines changed

13 files changed

+240
-0
lines changed

.vscode/tasks.json

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"tasks": [
3+
{
4+
"type": "cppbuild",
5+
"label": "C/C++: clang++ build active file",
6+
"command": "/usr/bin/clang++",
7+
"args": [
8+
"-fdiagnostics-color=always",
9+
"-g",
10+
"${file}",
11+
"-o",
12+
"${fileDirname}/${fileBasenameNoExtension}"
13+
],
14+
"options": {
15+
"cwd": "${fileDirname}"
16+
},
17+
"problemMatcher": [
18+
"$gcc"
19+
],
20+
"group": {
21+
"kind": "build",
22+
"isDefault": true
23+
},
24+
"detail": "Task generated by Debugger."
25+
}
26+
],
27+
"version": "2.0.0"
28+
}

covid-pandemic

39 KB
Binary file not shown.

covid-pandemic.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@
22
using namespace std;
33

44
int main() {
5+
6+
#ifndef ONLINE_JUDGE
7+
// for getting input from input.txt
8+
freopen("input.txt", "r", stdin);
9+
// for writing output to output.txt
10+
freopen("output.txt", "w", stdout);
11+
#endif
512
int t,count1,n,num,count0;
613
bool flag;
714
cin>>t;

hash-code.cpp

Whitespace-only changes.

input.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
3
2+
92 022
3+
82 12
4+
77 13
5+
2 false numeric

maxSubArraySum

35.4 KB
Binary file not shown.

maxSubArraySum.cpp

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
#include<iostream>
2+
#include<bits/stdc++.h>
3+
4+
using namespace std;
5+
6+
int main() {
7+
int t;
8+
cin>>t;
9+
while(t--){
10+
int n;
11+
cin>>n;
12+
int *a = new int[n];
13+
for(int i=0;i<n;i++) {
14+
cin>>a[i];
15+
}
16+
int ans = INT_MIN;
17+
int maxSumSoFar = 0;
18+
19+
for(int i=0; i <n;i++) {
20+
maxSumSoFar += a[i];
21+
if(maxSumSoFar<0){
22+
maxSumSoFar = 0;
23+
}
24+
if(maxSumSoFar>ans ){
25+
ans = maxSumSoFar;
26+
}
27+
28+
}
29+
cout<<ans<<endl;
30+
}
31+
return 0;
32+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>CFBundleDevelopmentRegion</key>
6+
<string>English</string>
7+
<key>CFBundleIdentifier</key>
8+
<string>com.apple.xcode.dsym.maxSubArraySum</string>
9+
<key>CFBundleInfoDictionaryVersion</key>
10+
<string>6.0</string>
11+
<key>CFBundlePackageType</key>
12+
<string>dSYM</string>
13+
<key>CFBundleSignature</key>
14+
<string>????</string>
15+
<key>CFBundleShortVersionString</key>
16+
<string>1.0</string>
17+
<key>CFBundleVersion</key>
18+
<string>1</string>
19+
</dict>
20+
</plist>
Binary file not shown.

output.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
82 12
2+
77 13
3+
92 022

0 commit comments

Comments
 (0)