diff --git a/JavaScript/findPeakElement.js b/JavaScript/findPeakElement.js
new file mode 100644
index 00000000..0247691b
--- /dev/null
+++ b/JavaScript/findPeakElement.js
@@ -0,0 +1,31 @@
+/**
+ * Given an integer array nums, find a peak element, and return its index. If the array contains multiple peaks, return the index to any of the peaks.
+
+Example 1:
+Input: nums = [1,2,3,1]
+Output: 2
+Explanation: 3 is a peak element and your function should return the index number 2.
+
+Example 2:
+Input: nums = [1,2,1,3,5,6,4]
+Output: 5
+Explanation: Your function can return either index number 1 where the peak element is 2, or index number 5 where the peak element is 6.
+
+ */
+
+/**
+ * @param {number[]} nums
+ * @return {number}
+ */
+var findPeakElement = function (nums) {
+ let left = 0,
+ right = nums.length - 1,
+ mid;
+
+ while (left < right) {
+ mid = Math.floor((right + left) / 2);
+ if (nums[mid] > nums[mid + 1]) right = mid;
+ else left = mid + 1;
+ }
+ return left;
+};
diff --git a/README.md b/README.md
index bf89f49f..58325e67 100644
--- a/README.md
+++ b/README.md
@@ -83,10 +83,10 @@ Check out ---> [Sample PR](https://github.com/codedecks-in/LeetCode-Solutions/pu
| # | Title | Solution | Time | Space | Difficulty | Tag | Tutorial |
| ---- | ------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | ------ | ------ | ---------- | --- | ---------------------------------------- |
| 136 | [Single Number](https://leetcode.com/problems/single-number/) | [Java](./Java/single-number.java)
[Python](./Python/single-number.py)
[C++](./C++/Single-Number.cpp) | _O(n)_ | _O(1)_ | Easy | | Using XOR |
-| 137 | [Single Number II](https://leetcode.com/problems/single-number-ii/) | [Python](./Python/single-number-ii.py)
[C++](./C++/Single-Number-II.cpp) | _O(n)_ | _O(1)_ | Medium | | |
-| 260 | [Single Number III](https://leetcode.com/problems/single-number-iii/) | [Python](./Python/single-number-iii.py)
[C++](./C++/Single-Number-III.cpp) | _O(n)_ | _O(1)_ | Medium | | |
-| 476 | [Number Complement](https://leetcode.com/problems/number-complement/) | [Java](./Java/number-complement.java)
[C++](./C++/Number-Complement.cpp) | _O(1)_ | _O(1)_ | Easy | | [Tutorial](https://youtu.be/6bp5V-O3zts) |
-| 520 | [Detect Capital Use](https://leetcode.com/problems/detect-capital/) | [Python](./Python/detect-capital.py)
[C++](./C++/Detect-Capital.cpp) | _O(n)_ | _O(1)_ | Easy | | |
+| 137 | [Single Number II](https://leetcode.com/problems/single-number-ii/) | [Python](./Python/single-number-ii.py)
[C++](./C++/Single-Number-II.cpp) | _O(n)_ | _O(1)_ | Medium | | |
+| 260 | [Single Number III](https://leetcode.com/problems/single-number-iii/) | [Python](./Python/single-number-iii.py)
[C++](./C++/Single-Number-III.cpp) | _O(n)_ | _O(1)_ | Medium | | |
+| 476 | [Number Complement](https://leetcode.com/problems/number-complement/) | [Java](./Java/number-complement.java)
[C++](./C++/Number-Complement.cpp) | _O(1)_ | _O(1)_ | Easy | | [Tutorial](https://youtu.be/6bp5V-O3zts) |
+| 520 | [Detect Capital Use](https://leetcode.com/problems/detect-capital/) | [Python](./Python/detect-capital.py)
[C++](./C++/Detect-Capital.cpp) | _O(n)_ | _O(1)_ | Easy | | |
| 1486 | [XOR Operation in an Array](https://leetcode.com/problems/xor-operation-in-an-array/) | [Java](./Java/xor-op-in-array.java) | _O(n)_ | _O(1)_ | Easy | | Using XOR |
@@ -97,9 +97,9 @@ Check out ---> [Sample PR](https://github.com/codedecks-in/LeetCode-Solutions/pu
# Sort
-| # | Title | Solution | Time | Space | Difficulty | Tag | Tutorial |
-| ---- | --------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | ------ | ------ | ---------- | --- | ---------------------------------------- |
-| 973 | [K Closest Points to Origin](https://leetcode.com/problems/k-closest-points-to-origin/) | [C++](./C++/k-closest-points-to-origin.cpp) | _O(n)_ | _O(1)_ | Medium | | |
+| # | Title | Solution | Time | Space | Difficulty | Tag | Tutorial |
+| --- | --------------------------------------------------------------------------------------- | ------------------------------------------- | ------ | ------ | ---------- | --- | -------- |
+| 973 | [K Closest Points to Origin](https://leetcode.com/problems/k-closest-points-to-origin/) | [C++](./C++/k-closest-points-to-origin.cpp) | _O(n)_ | _O(1)_ | Medium | | |
+- | [Gourav Rusiya](https://github.com/GouravRusiya30/)
| India | Java | [codedecks](https://www.youtube.com/c/codedecks/)
| Israel | JavaScript | [Twitter](https://twitter.com/dimshik100)
| India | Python | [Github](https://github.com/Optider) |
-| [Lokendra Bohra](https://github.com/lokendra1704/)
| India | Python | [Leetcode](https://t.co/u0OByxhcHA)
| Russia | Python | [Twitter](https://twitter.com/YuriSpiridonov)
| India | Javascript | [Twitter](https://twitter.com/naveen_kashyapp)
| India | C++ | [Twitter](https://twitter.com/ruDra_Mishra407)
| India | Python | [Twitter](https://twitter.com/SachinSinghNe17)
| India | Java | [Leetcode](https://leetcode.com/girish13/)
| India | Java | [Leetcode](https://leetcode.com/being_kevin/)
| Tunisia | Python | [Leetcode](https://leetcode.com/nourgrati/)
| India | C++ | [Leetcode](https://leetcode.com/avi_002/) |
-| [Ishika Goel](https://github.com/ishikagoel5628)
| India | C++ | [Leetcode](https://leetcode.com/ishikagoel5628/) |
-| [Fenil Dobariya](https://github.com/ifenil)
| India | C++ | [Leetcode](https://leetcode.com/prashansaaa/) |
-| [Ishu Raj](https://github.com/ir2010)
| India | C++ | [Leetcode](https://leetcode.com/ishuraj2010/) |
-| [Rakesh Bhadhavath](https://github.com/Revenge-Rakesh)
| India | Python | [Github](https://github.com/Jaseemck) |
-| [Ilias Khan](https://github.com/IliasKhan)
| India | C++ | [Hackerrank](https://www.hackerrank.com/sahashamoyeeta)
| India | Java | [codedecks](https://www.youtube.com/c/codedecks/)
| Israel | JavaScript | [Twitter](https://twitter.com/dimshik100)
| India | Python | [Github](https://github.com/Optider) |
+| [Lokendra Bohra](https://github.com/lokendra1704/)
| India | Python | [Leetcode](https://t.co/u0OByxhcHA)
| Russia | Python | [Twitter](https://twitter.com/YuriSpiridonov)
| India | Javascript | [Twitter](https://twitter.com/naveen_kashyapp)
| India | C++ | [Twitter](https://twitter.com/ruDra_Mishra407)
| India | Python | [Twitter](https://twitter.com/SachinSinghNe17)
| India | Java | [Leetcode](https://leetcode.com/girish13/)
| India | Java | [Leetcode](https://leetcode.com/being_kevin/)
| Tunisia | Python | [Leetcode](https://leetcode.com/nourgrati/)
| India | C++ | [Leetcode](https://leetcode.com/avi_002/) |
+| [Ishika Goel](https://github.com/ishikagoel5628)
| India | C++ | [Leetcode](https://leetcode.com/ishikagoel5628/) |
+| [Fenil Dobariya](https://github.com/ifenil)
| India | C++ | [Leetcode](https://leetcode.com/prashansaaa/) |
+| [Ishu Raj](https://github.com/ir2010)
| India | C++ | [Leetcode](https://leetcode.com/ishuraj2010/) |
+| [Rakesh Bhadhavath](https://github.com/Revenge-Rakesh)
| India | Python | [Github](https://github.com/Jaseemck) |
+| [Ilias Khan](https://github.com/IliasKhan)
| India | C++ | [Hackerrank](https://www.hackerrank.com/sahashamoyeeta)