Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
152 commits
Select commit Hold shift + click to select a range
e39331d
Create shell_sort.cpp
ruturaj-gh Sep 28, 2023
501a08b
Update README.md
Nikhil-2002 Sep 28, 2023
35cdd82
Create largestelement.c
SRUJANA2199 Oct 1, 2023
a1f3ab2
Merge pull request #12 from SRUJANA2199/patch-1
Nikhil-2002 Oct 1, 2023
f73e7bc
Merge pull request #11 from ruturaj-gh/main
Nikhil-2002 Oct 1, 2023
8a4c79f
Added Program To Find Smallest Element in an Array
piyush-gambhir Oct 1, 2023
db4cd2d
countingevenodd.c
SRUJANA2199 Oct 1, 2023
c50ad7a
Merge pull request #13 from Piyush-Gambhir/find-the-smallest-element-…
Nikhil-2002 Oct 1, 2023
cd46714
Merge pull request #14 from SRUJANA2199/patch-2
Nikhil-2002 Oct 1, 2023
34e41e6
Finding the Longest Palindrome in an Array
TechWhiz0 Oct 1, 2023
6c54e53
Merge pull request #15 from educationalgamer/main
Nikhil-2002 Oct 1, 2023
33b8210
issue resolved of removing duplicates from an array
Sam-bhav-20 Oct 1, 2023
184d97f
Merge pull request #16 from Sam-bhav-20/main
Nikhil-2002 Oct 1, 2023
234a669
Issue resolved of finding that arrays are disjoint or not
Sam-bhav-20 Oct 1, 2023
1ea1ec4
Merge pull request #17 from Sam-bhav-20/main
Nikhil-2002 Oct 1, 2023
5b8ddea
added code of sum of array elements in cpp.
Mahesh0911 Oct 1, 2023
5e8f0cc
Merge pull request #18 from Mahesh0911/main
Nikhil-2002 Oct 2, 2023
5d2c5c5
Create finding_repeating_elements.c
dikshant182004 Oct 2, 2023
18d7ba2
Reverse_an_array_cpp_added
Shivansh175 Oct 2, 2023
227b934
Merge pull request #21 from Shivansh175/Shivansh175
Nikhil-2002 Oct 2, 2023
6d3ac38
Merge pull request #20 from dikshant182004/patch-1
Nikhil-2002 Oct 2, 2023
8c65b92
Revert "Finding the Longest Palindrome in an Array"
Nikhil-2002 Oct 2, 2023
5be6732
Merge pull request #22 from Nikhil-2002/revert-15-main
Nikhil-2002 Oct 2, 2023
52d7629
Longest palindrome subsequence length
shiva1718 Oct 2, 2023
b3158c4
Create CONTRIBUTING.md
Nikhil-2002 Oct 3, 2023
0125474
Merge pull request #23 from shiva1718/longest_palindrome_subsequence_…
Nikhil-2002 Oct 3, 2023
1596a52
Create Kadane's Algorithm.cpp
blindaks Oct 3, 2023
e1f80af
Added the folder and all executable files related to program
aasn0119 Oct 3, 2023
b181599
factorial in c
lokeshwaraprasad Oct 3, 2023
49ad20e
Create turtle.py
NayanPrakash11 Oct 3, 2023
6525748
Merge pull request #28 from NayanPrakash11/patch-1
Nikhil-2002 Oct 3, 2023
c65be0e
Merge pull request #27 from lokeshwaraprasad/factorial.c
Nikhil-2002 Oct 3, 2023
051c224
Merge pull request #26 from aasn0119/count_even_Odd
Nikhil-2002 Oct 3, 2023
b6df739
Merge pull request #25 from blindaks/main
Nikhil-2002 Oct 3, 2023
671262f
Add files via upload
musaibbatghar Oct 3, 2023
d001c45
Add files via upload
musaibbatghar Oct 3, 2023
1a85c83
Create Knapsack.py
musaibbatghar Oct 3, 2023
fc55328
Merge pull request #1 from musaibbatghar/musaibbatghar-patch-1
musaibbatghar Oct 3, 2023
eeb8dbf
Create reverse_an_array.c @hactoberfest
dikshant182004 Oct 3, 2023
db51ed7
Fixed- Added DSU and Trie DataStructure
FardeenCODEIIEST Oct 3, 2023
fc2f8b4
Create Reverse_Array.java
Yash493 Oct 3, 2023
b847f43
Merge pull request #32 from Yash493/patch-1
Nikhil-2002 Oct 4, 2023
82e151c
Merge pull request #31 from dikshant182004/patch-2
Nikhil-2002 Oct 4, 2023
739bc55
Merge pull request #29 from musaibbatghar/main
Nikhil-2002 Oct 4, 2023
fc26fbd
binary search added
Oct 4, 2023
b538c1a
Kadane's algorithm
AnkitaGupta2002 Oct 4, 2023
061e532
Create rotateimage.cpp
gargdeepanshi Oct 4, 2023
4badc11
Added_count_frequency_of_array_items.cpp
Mahi5902 Oct 4, 2023
cb7652c
Create Count_number_of_subarray_having_given_xor.cpp
Mahi5902 Oct 4, 2023
3bd8ab8
Create BinarySearch.cpp
isaksham2003 Oct 4, 2023
448d641
added oddEvenCount in javaScript
hrushi2003 Oct 4, 2023
72966e7
Merge sort with better time complexity
vaishnavin01 Oct 4, 2023
cb2011a
added the program which contain so many operation on bits(bit manipul…
Legend015 Oct 5, 2023
2bc52f5
Added Java Program To Count Even and Odd Numbers
piyush-gambhir Oct 5, 2023
86b36aa
Added Java Program to Sort Elements of an Array
piyush-gambhir Oct 5, 2023
91c25c0
Merge pull request #45 from Piyush-Gambhir/java_sort_elements_in_array
Nikhil-2002 Oct 5, 2023
8c63543
Merge pull request #44 from Piyush-Gambhir/java_count_number_of_odd_e…
Nikhil-2002 Oct 5, 2023
f9d0f03
Merge pull request #43 from Legend015/main
Nikhil-2002 Oct 5, 2023
b458174
Merge pull request #42 from vaishnavin01/sorting
Nikhil-2002 Oct 5, 2023
4b8fe39
Merge pull request #41 from hrushi2003/oddEvenCount
Nikhil-2002 Oct 5, 2023
f0383eb
Merge pull request #40 from isaksham2003/patch-1
Nikhil-2002 Oct 5, 2023
f4b8b7d
Merge pull request #39 from Mahi5902/patch-2
Nikhil-2002 Oct 5, 2023
b43a8c6
Merge pull request #38 from Mahi5902/patch-1
Nikhil-2002 Oct 5, 2023
f139b28
Merge pull request #37 from gargdeepanshi/patch-1
Nikhil-2002 Oct 5, 2023
0293b33
Merge pull request #35 from AnkitaGupta2002/AnkitaGupta2002-patch-1
Nikhil-2002 Oct 5, 2023
6b6838d
Merge pull request #34 from Shreyan111/new-cpp-code
Nikhil-2002 Oct 5, 2023
73537b4
Merge pull request #33 from FardeenCODEIIEST/Add-DSU-trie
Nikhil-2002 Oct 5, 2023
a871685
Create smallest element in array.c
aarth01 Oct 6, 2023
359c511
Create To find longest palindrome in a array
Chiragchandel2000 Oct 6, 2023
f7c58eb
Create To find all repeating elements in an array.
Chiragchandel2000 Oct 6, 2023
e6d4f97
Create To check if two arrays are disjoint or not
Chiragchandel2000 Oct 6, 2023
64527ff
Merge pull request #49 from Chiragchandel2000/patch-3
Nikhil-2002 Oct 6, 2023
dd57b76
Merge pull request #48 from Chiragchandel2000/patch-2
Nikhil-2002 Oct 6, 2023
317dcc4
Merge pull request #47 from Chiragchandel2000/patch-1
Nikhil-2002 Oct 6, 2023
87e1892
Merge pull request #46 from aarth01/patch-1
Nikhil-2002 Oct 6, 2023
138e8df
Create Pairwise swap elements of a linked list
ayushiGautam-0110 Oct 7, 2023
84eca93
Merge pull request #50 from ayushiGautam-0110/patch-1
Nikhil-2002 Oct 7, 2023
624623c
Create KahnsAlgo.cpp
UtkarshTrivedi2934 Oct 8, 2023
918603d
Create searchInRotArray.java
Sway2003 Oct 8, 2023
aa95559
Merge pull request #53 from Sway2003/patch-1
Nikhil-2002 Oct 8, 2023
16459df
Merge pull request #52 from UtkarshTrivedi2934/patch-1
Nikhil-2002 Oct 8, 2023
fca750b
Create longest_palindrome_in_array
nida242004 Oct 8, 2023
d4abf43
Update longest_palindrome_in_array
nida242004 Oct 8, 2023
e66a67f
Create Pigeonhole Sort
Aheri7 Oct 8, 2023
9ccb0da
Create if a number is an Armstrong Number
anuj-kashyap Oct 9, 2023
886451d
Merge pull request #57 from anuj-kashyap/patch-1
Nikhil-2002 Oct 10, 2023
bbf55f3
Merge pull request #55 from Aheri7/patch-1
Nikhil-2002 Oct 10, 2023
7ffc70a
Merge pull request #54 from nida242004/palindrome
Nikhil-2002 Oct 10, 2023
c700ef0
Create rotate_array_right.cpp
ss987 Oct 10, 2023
0926837
Create CheckEvenandOddInArray.cpp
rahul12043 Oct 11, 2023
ce8690e
added C scripts of Dynamic Programming
Praneesh-Sharma Oct 11, 2023
49b5905
Create quickSort.cpp
Subrat29 Oct 11, 2023
296850a
palindrome checker
NickSahu Oct 12, 2023
976feb0
added PalindromeChecker.java
krutika-ladani Oct 13, 2023
5951a9e
Merge pull request #67 from krutika-ladani/palindrome-checker
Nikhil-2002 Oct 13, 2023
00e52d3
Created soln.cpp for issue #9
guru-divine Oct 14, 2023
500ca05
Create Palindrom_checkerwithJava.java
mdsarfarazalam840 Oct 15, 2023
c92bd7b
Create ArrayDisjoinOrNot.java
mdsarfarazalam840 Oct 15, 2023
3c6dade
Create EvenOddinArray.java
mdsarfarazalam840 Oct 15, 2023
77ff609
Create ReverseArrayUsingScanner.java
mdsarfarazalam840 Oct 15, 2023
b310f50
Create smallestelementusingScanner.java
mdsarfarazalam840 Oct 15, 2023
42c878f
Merge pull request #74 from mdsarfarazalam840/patch-5
Nikhil-2002 Oct 15, 2023
9ad22c2
Merge pull request #73 from mdsarfarazalam840/patch-4
Nikhil-2002 Oct 15, 2023
e5027bf
Merge pull request #72 from mdsarfarazalam840/patch-3
Nikhil-2002 Oct 15, 2023
7fcf439
Merge pull request #60 from ss987/patch-1
Nikhil-2002 Oct 15, 2023
6c19c6b
Merge pull request #61 from rahul12043/EvenandOdd
Nikhil-2002 Oct 15, 2023
4a13670
Merge pull request #62 from Praneesh-Sharma/C-algorithms
Nikhil-2002 Oct 15, 2023
3fc9fad
Merge pull request #63 from Subrat29/patch-1
Nikhil-2002 Oct 15, 2023
4e47211
Merge pull request #64 from NickSahu/Nick
Nikhil-2002 Oct 15, 2023
ea0c906
Merge pull request #69 from guru-divine/main
Nikhil-2002 Oct 15, 2023
ac89259
Create Minimum Sum of Four Digit Number After Splitting Digits
ishita3513 Oct 15, 2023
91411d5
Create Palindrome_Num_Checker.cpp
rahul12043 Oct 15, 2023
8460d46
Update palindrome.cpp
mhdsabah Oct 15, 2023
ecb2d1b
added kadans algorithm and unique element in array code in cpp
VishalAggarwal2 Oct 15, 2023
69609c5
added evaluate postfix exp
kashish-219 Oct 15, 2023
d8a6969
Merge pull request #80 from kashish-219/postfix
Nikhil-2002 Oct 16, 2023
40343e0
greatest element in array
NickSahu Oct 16, 2023
d90d491
added bfs code
livisha211 Oct 16, 2023
2bbca41
Create NGE.java
URVASHI-PAHWA Oct 17, 2023
b8e8643
added pattern program
priyanshtiwari001 Oct 18, 2023
bf723d1
Added Dijkstra's algorithm
Souradeephazra123 Oct 20, 2023
b449ee9
Add files via upload
gautamjain9615 Oct 20, 2023
29fbf6c
Create README.md
gautamjain9615 Oct 20, 2023
fd818e9
Created Merge Sort
Alisha-786 Oct 20, 2023
a414c28
Created CONTRIBUTING.md for the project
Shivraj-Nakum Oct 20, 2023
156da09
Merge pull request #91 from Alisha-786/main
Nikhil-2002 Oct 20, 2023
93f9c8c
Merge pull request #70 from mdsarfarazalam840/patch-1
Nikhil-2002 Oct 20, 2023
c433a26
Merge pull request #71 from mdsarfarazalam840/patch-2
Nikhil-2002 Oct 20, 2023
98bb696
Merge pull request #76 from ishita3513/patch-1
Nikhil-2002 Oct 20, 2023
78e7669
Merge pull request #77 from rahul12043/PalindromeNumChecker
Nikhil-2002 Oct 20, 2023
4c659a0
Merge pull request #78 from mhdsabah/main
Nikhil-2002 Oct 20, 2023
aa711fa
Merge pull request #79 from VishalAggarwal2/main
Nikhil-2002 Oct 20, 2023
49d5b39
Merge pull request #81 from NickSahu/Nick
Nikhil-2002 Oct 20, 2023
1f40249
Merge pull request #82 from livisha/main
Nikhil-2002 Oct 21, 2023
3fe27ec
Merge pull request #83 from URVASHI-PAHWA/patch-1
Nikhil-2002 Oct 21, 2023
9eecf50
Create maximum-product-of-two-elements-in-an-array
ishita3513 Oct 21, 2023
2420689
Merge pull request #99 from ishita3513/patch-2
Nikhil-2002 Oct 21, 2023
573875c
Create count-the-number-of-complete-components
ishita3513 Oct 21, 2023
fcb6b52
Create Take input in String form and convert to array format for oper…
ishita3513 Oct 21, 2023
44d1cbc
added pattern
priyanshtiwari001 Oct 22, 2023
3cb4482
Merge pull request #87 from priyanshtiwari001/pattern-question
Nikhil-2002 Oct 22, 2023
414dcb3
Merge pull request #100 from ishita3513/patch-3
Nikhil-2002 Oct 22, 2023
2b882ab
Merge pull request #101 from ishita3513/patch-4
Nikhil-2002 Oct 22, 2023
f5bbb28
Create shortest_path
Souradeephazra123 Oct 27, 2023
373cf72
Merge pull request #1 from Souradeephazra123/Souradeephazra123-patch-1
Souradeephazra123 Oct 27, 2023
9313fb2
Merge pull request #92 from Shivraj-Nakum/main
Nikhil-2002 Feb 19, 2025
c33d76a
Merge pull request #89 from Souradeephazra123/main
Nikhil-2002 Feb 19, 2025
ed3e852
Merge pull request #90 from gautamjain9615/main
Nikhil-2002 Feb 19, 2025
14775b3
Update README.md
Nikhil-2002 Oct 1, 2025
edf5fa9
Added F1 Race Predictor program for Hacktoberfest 2025
AryanJagaty Oct 2, 2025
3e13b37
Merge pull request #116 from AryanJagaty/add-f1-race-predictor
Nikhil-2002 Oct 2, 2025
1a45dd4
added rain water problem
aastikdas Oct 21, 2025
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
61 changes: 61 additions & 0 deletions 2160. Minimum Sum of Four Digit Number After Splitting Digits
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
/*
Get all digits of num.
Sort them.
To get the minimum sum. We need to choose 1st and 2nd digits as tens digits and 3rd and 4th as ones digits.
As when the tens digits will be minimum, then only we will get minimum sum.
For example:
5643=>3,4,5,6
30+40+5+6=86(min)

Other possibilities:
30+50+4+6=90
30+60+4+5=101
40+50+4+6=100 and so on.

Method 1:
Time complexity: O(nlogn)
Use array to store the digits of num.
*/

class Solution {
public int minimumSum(int num) {
int[] res=new int[4];
int i=0;
while(num>0){
res[i]=num%10;
num/=10;
i++;
}
Arrays.sort(res)
return res[0]*10+res[2]+res[1]*10+res[3];
}
}





//method 2
/*
Method 2:
Use priorityqueue to store the digits of num.
Time complexity: O(n)
*/


class Solution {
public int minimumSum(int num) {
PriorityQueue<Integer>pq=new PriorityQueue<>();
//complexity to insert: O(1)
while(num>0){
pq.offer(num%10);
num/=10;
}
//complexity to remove: O(n)
int a=10*pq.remove();
int b=10*pq.remove();
int c=pq.remove();
int d=pq.remove();
return a+b+c+d;
}
}
88 changes: 88 additions & 0 deletions BFS.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
// Program to print BFS traversal from a given
// source vertex. BFS(int s) traverses vertices
// reachable from s.
#include<bits/stdc++.h>
using namespace std;

// This class represents a directed graph using
// adjacency list representation
class Graph
{
int V; // No. of vertices

// Pointer to an array containing adjacency
// lists
vector<list<int>> adj;
public:
Graph(int V); // Constructor

// function to add an edge to graph
void addEdge(int v, int w);

// prints BFS traversal from a given source s
void BFS(int s);
};

Graph::Graph(int V)
{
this->V = V;
adj.resize(V);
}

void Graph::addEdge(int v, int w)
{
adj[v].push_back(w); // Add w to v’s list.
}

void Graph::BFS(int s)
{
// Mark all the vertices as not visited
vector<bool> visited;
visited.resize(V,false);

// Create a queue for BFS
list<int> queue;

// Mark the current node as visited and enqueue it
visited[s] = true;
queue.push_back(s);

while(!queue.empty())
{
// Dequeue a vertex from queue and print it
s = queue.front();
cout << s << " ";
queue.pop_front();

// Get all adjacent vertices of the dequeued
// vertex s. If a adjacent has not been visited,
// then mark it visited and enqueue it
for (auto adjecent: adj[s])
{
if (!visited[adjecent])
{
visited[adjecent] = true;
queue.push_back(adjecent);
}
}
}
}

// Driver program to test methods of graph class
int main()
{
// Create a graph given in the above diagram
Graph g(4);
g.addEdge(0, 1);
g.addEdge(0, 2);
g.addEdge(1, 2);
g.addEdge(2, 0);
g.addEdge(2, 3);
g.addEdge(3, 3);

cout << "Following is Breadth First Traversal "
<< "(starting from vertex 2) \n";
g.BFS(2);

return 0;
}
53 changes: 53 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# Contributing to Programming_HacktoberFest-2023

Welcome to Programming_Hactober23 ! We appreciate your interest in contributing. Before you get started, please read and follow these guidelines.

## Prerequisites

Prior to beginning your contributions, please ensure the following:

- Possess a GitHub Account.
- Complete your contributor registration on the [Hacktoberfest 2023 website.](https://hacktoberfest.com/)

<br/>

## How to Contribute

1. **Look for the issue you wish to solve** on the project's issue tracker.

2. **Comment on the issue**: Please comment on the issue, indicating your interest in working on it. You can use a comment like: "Please assign me this issue."


**Note**:

- If the assigned contributor takes longer than expected to work on the issue, the maintainer may reassign the issue to the next person in the comment queue.

<br/>

## Commit your changes:

- Make your changes or additions to the code, documentation, or any other improvements.

- Test your changes thoroughly.

## Contribution Guidelines

- Please ensure your code and contributions align with the project's purpose and goals.

- Follow the coding style and guidelines of the project.

- Keep your commits and pull requests concise and clearly describe the changes you've made.

- Do not submit spammy, trivial, or duplicate pull requests. Quality contributions are highly encouraged.

<br/>

## Questions and Support

- If you have questions or need support related to your contributions or the project, feel free to tag and ask your doubts to the repository maintainer.

- Thank you for contributing to Programming_HacktoberFest-2023! Your contributions are greatly appreciated.

<br/>

<b> Happy contributing! 🚀 </b>
35 changes: 35 additions & 0 deletions CheckEvenandOddInArray.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#include<iostream>
using namespace std;

int main(){

int size;
cout<<"Enter Size of Array: ";
cin>>size;

int arr[size];

cout<<" Enter Elements in the array: ";

for(int i=0; i<size; i++){
cin>>arr[i];
}

cout<<" Even elements: ";

for(int i=0; i<size; i++){
if(arr[i]%2==0){
cout<<arr[i]<<" ";
}
}

cout<<endl;
cout<<" Odd elements: ";

for(int i=0; i<size; i++){
if(arr[i]%2==1){
cout<<arr[i]<<" ";
}
}

}
37 changes: 37 additions & 0 deletions EvenOddinArray.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import java.util.Scanner;

public class EvenOddCounter {

public static void countEvenOdd(int[] arr) {
int evenCount = 0;
int oddCount = 0;

for (int num : arr) {
if (num % 2 == 0) {
evenCount++;
} else {
oddCount++;
}
}

System.out.println("Even numbers: " + evenCount);
System.out.println("Odd numbers: " + oddCount);
}

public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);

System.out.print("Enter the size of the array: ");
int size = scanner.nextInt();
int[] array = new int[size];

System.out.println("Enter elements of the array:");
for (int i = 0; i < size; i++) {
array[i] = scanner.nextInt();
}

scanner.close();

countEvenOdd(array);
}
}
29 changes: 29 additions & 0 deletions FindUniqueElement.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#include <iostream>
#include <vector>
#include <set>

int main() {
int n;
std::cout << "Enter the number of elements: ";
std::cin >> n;

std::vector<int> arr(n);

std::cout << "Enter " << n << " elements: ";
for (int i = 0; i < n; ++i) {
std::cin >> arr[i];
}

std::set<int> uniqueElements;
for (int i : arr) {
uniqueElements.insert(i);
}

std::cout << "Unique elements in the array: ";
for (int element : uniqueElements) {
std::cout << element << " ";
}
std::cout << std::endl;

return 0;
}
48 changes: 48 additions & 0 deletions Gr8stIntInArr.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
#include <iostream>
using namespace std;

int findLargestElement(int arr[], int size) {
if (size <= 0) {
// Ha the case of an empty array or invalid size
return -1;
}

int largest = arr[0]; // Assuming the first element is the largest

for (int i = 1; i < size; i++) {
if (arr[i] > largest) {
largest = arr[i]; // Updating largest if current element is greater
}
}

return largest;
}

int main() {
int size;

cout << "Enter the size of the array: ";
cin >> size;

if (size <= 0) {
cout << "Invalid array size." <<endl;
return 1;
}

int arr[size];

cout << "Enter the elements of the array, separated by spaces:" <<endl;
for (int i = 0; i < size; i++) {
cin >> arr[i];
}

int largest = findLargestElement(arr, size);

if (largest != -1) {
cout << "The largest element in the array is: " << largest <<endl;
} else {
cout << "The array is empty or has an invalid size." <<endl;
}

return 0;
}
Loading