Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
23 changes: 21 additions & 2 deletions PARTICIPANTS.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

<h1 align="center">Hi 👋, Welcome Contributers!!</h1>

<p align="center">
Expand All @@ -8,6 +7,7 @@
<h3 align="center">HacktoberFest 2022 contributers details</h3>

---

### Connect with me:

<img align="right" src="https://avatars3.githubusercontent.com/RajkumarSony?size=100" width="100px;" alt=""/>
Expand All @@ -20,6 +20,7 @@
---

---

### Connect with me:

<img align="right" src="https://avatars3.githubusercontent.com/kuldip23798?size=100" width="100px;" alt=""/>
Expand All @@ -41,6 +42,7 @@
- 🔭 Connect with me: **[Harshdev625](https://github.com/Harshdev625)**

---

### Connect with me:

<img align="right" src="https://avatars3.githubusercontent.com/manavagr1108?size=100" width="100px;" alt=""/>
Expand All @@ -51,6 +53,7 @@
- 🔭 Connect with me: **[manavagr1108](https://github.com/manavagr1108)**

---

### Connect with me:

<img align="right" src="https://avatars3.githubusercontent.com/rivubanerjee04?size=100" width="100px;" alt=""/>
Expand All @@ -61,6 +64,7 @@
- 🔭 Connect with me: **[rivubanerjee04](https://github.com/rivubanerjee04)**

---

### Connect with me:

<img align="right" src="https://avatars3.githubusercontent.com/sarapapa-sp?size=100" width="100px;" alt=""/>
Expand All @@ -71,6 +75,7 @@
- 🔭 Connect with me: **[rivubanerjee04](https://github.com/sarapapa-sp)**

---

### Connect with me:

<img align="right" src="https://avatars3.githubusercontent.com/Sam0204?size=100" width="100px;" alt=""/>
Expand All @@ -90,6 +95,7 @@
- 🔭 Connect with me: **[SwastikMo](https://github.com/SwastikMo)**

---

### Connect with me:

<img align="right" src="https://avatars.githubusercontent.com/u/56904319?v=4 size=100" width="100px;" alt=""/>
Expand All @@ -100,11 +106,12 @@
- 🔭 Connect with me: **[Prakhar Khandelwal](https://github.com/tigllon)**

---

### Connect with me:

<img align="right" src="https://avatars3.githubusercontent.com/<Github-ID>?size=100" width="100px;" alt=""/>

- 👨‍💻 My name is *<Name>r**
- 👨‍💻 My name is \*<Name>r\*\*
- 🌱 I’m a <Profession>.
- 📫 Reach me: **<Email-ID>**
- 🔭 Connect with me: **[<Github-ID>](https://github.com/<Github-ID>)**
Expand Down Expand Up @@ -132,6 +139,7 @@
- 🔭 Connect with me: **[Vikash0122](https://github.com/Vikash0122))**

---

### Connect with me:

<img align="right" src="https://avatars3.githubusercontent.com/<Github-ID>?size=100" width="100px;" alt=""/>
Expand All @@ -142,3 +150,14 @@
- 🔭 Connect with me: **[Piyushjar](https://github.com/piyushjar))**

---

### Connect with me:

<img align="right" src="https://avatars3.githubusercontent.com/manassahoo-dev?size=100" width="100px;" alt="Manas Sahoo"/>

- 👨‍💻 My name is **Manas Sahoo**
- 🌱 I’m a Senior Frontend Developer.
- 📫 Reach me: **[email protected]**
- 🔭 Connect with me: **[Manas Sahoo](https://github.com/manassahoo-dev))**

---
17 changes: 17 additions & 0 deletions java/1512-Number-of-Good-Pairs.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import java.util.HashMap;
import java.util.Map;

//1512. Number of Good Pairs
class Solution {
public int numIdenticalPairs(int[] nums) {
int res = 0;
Map<Integer,Integer> count= new HashMap<Integer,Integer>();
for (int a: nums)
{
int cur=count.getOrDefault(a,0);
res += cur;
count.put(a,cur+1);
}
return res;
}
}
16 changes: 16 additions & 0 deletions java/2395-Find-Subarrays-With-Equal-Sum.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import java.util.Set;
import java.util.HashSet;

//2395. Find Subarrays With Equal Sum

class Solution {
public boolean findSubarrays(int[] nums) {
Set<Integer> set = new HashSet<>(); // To Track previous sum calculated

for(int i=1; i < nums.length; i++){
set.add(nums[i] + nums[i-1]);
}
// Check if sum already exist
return set.size() != (nums.length -1);
}
}
20 changes: 20 additions & 0 deletions java/2418-Sort-the-People.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;

class Solution {
public String[] sortPeople(String[] names, int[] heights) {
Map<Integer, String> map = new HashMap<>();
for (int i = 0; i < names.length; i++) {
map.put(heights[i], names[i]);
}
Arrays.sort(heights);
String[] result = new String[heights.length];
int index = 0;
for (int i = heights.length - 1; i >= 0; i--) {
result[index] = map.get(heights[i]);
index++;
}
return result;
}
}
11 changes: 11 additions & 0 deletions java/387-First-Unique-Character-in-a-String.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
class Solution {
public int firstUniqChar(String s) {
for(int i=0; i< s.length(); i++){
// If the character is found only once, then indexOf and lastIndexOf will point to same index position.
if(s.indexOf(s.charAt(i)) == s.lastIndexOf(s.charAt(i))){
return i;
}
}
return -1;
}
}
41 changes: 41 additions & 0 deletions javascript/DutchNationalFlag-Problem.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
// Given an array A[] consisting of only 0s, 1s, and 2s. The task is to write a function that sorts
// the given array. The functions should put all 0s first, then all 1s and all 2s in last.
// This Problem is also known as Dutch National Flag.

// First Sol --> Using Sort
// Second Sol ---> Count Sort

//Efficient Solution

function DutchNationalFlagSort(array){

let low =0;
let mid = 0;
let high = array.length -1;
let temp =0;

while(mid <=high){

if(array[mid] == 0){
temp = array[low]
array[low] = array[mid]
array[mid] = temp

low++;
mid++;
}else if(array[mid] == 1){
mid++;
}else{
temp = array[mid]
array[mid] = array[high]
array[high] = temp

high--
}
}

return array;
}


console.log(DutchNationalFlagSort([0, 1, 1, 0, 1, 2, 1, 2, 0, 0, 0, 1 ]));