From a1ffcfcad18de7fb1cd9eefcc88133d98afa8b17 Mon Sep 17 00:00:00 2001 From: somya2213148pal Date: Wed, 1 May 2024 20:00:38 +0530 Subject: [PATCH 1/2] solution1 --- Question-1/solution1.md | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 Question-1/solution1.md diff --git a/Question-1/solution1.md b/Question-1/solution1.md new file mode 100644 index 0000000..c2cbba3 --- /dev/null +++ b/Question-1/solution1.md @@ -0,0 +1,34 @@ +**Solution** + #include + using namespace std; + int main(){ + int t; + cin>>t; + while(t--){ + int n; + cin>>n; + vector sticks(n); + for(int i=0;i>sticks[i]; + } + sort(sticks.begin(), sticks.end(), greater()); + int ans = 0; + int count = 0; + + for (int i = 0; i < n - 1; i++) { + if (sticks[i] == sticks[i + 1]) { + count++; + if (count >= 3) { + ans++; + count = 0; + } + } else { + count = 0; + } + } + + cout << ans << endl; + } + +    return 0; +} \ No newline at end of file From fdfdc76e846b2f83b05f6ff316d496dd8555c7b6 Mon Sep 17 00:00:00 2001 From: somya2213148pal Date: Wed, 1 May 2024 20:03:07 +0530 Subject: [PATCH 2/2] solution2 --- question-2/solution2.md | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 question-2/solution2.md diff --git a/question-2/solution2.md b/question-2/solution2.md new file mode 100644 index 0000000..5b8f888 --- /dev/null +++ b/question-2/solution2.md @@ -0,0 +1,30 @@ +#include + + using namespace std; + + int main(){ + + int t; + + cin>>t; + + while(t--){ + + int n; + + cin>>n; + + int ans=0; + + for (int i = 5; n / i >= 1; i *= 5){ + + zeros += n / i; + + } + + cout<