This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Write a function to find the longest common prefix | |
string amongst an array of strings. | |
If there is no common prefix, return an empty string "". | |
Example 1: | |
Input: strs = ["flower","flow","flight"] | |
Output: "fl" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
nums1.length == m | |
nums2.length == n | |
0 <= m <= 1000 | |
0 <= n <= 1000 | |
1 <= m + n <= 2000 | |
-10**6 <= nums1[i], nums2[i] <= 10**6 | |
*/ | |
var findMedianSortedArrays = function(nums1, nums2) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
author Oleg Kornilov | |
kornilovoy@gmail.com | |
Runtime: 2025 ms, faster than 11.72% of JavaScript online submissions for Longest Palindromic Substring. | |
Memory Usage: 52 MB, less than 12.11% of JavaScript online submissions for Longest Palindromic Substring. | |
*/ | |
var longestPalindrome = function(s) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
author Oleg Kornilov | |
kornilovoy@gmail.com | |
github.com/OlegKorn | |
https://leetcode.com/problems/palindrome-number/solution/ | |
*/ | |
var isPalindrome = function(x) { | |
x = x.toString() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://leetcode.com/problems/two-sum/ | |
/* | |
author Oleg Kornilov | |
kornilovoy@gmail.com | |
Given an array of integers nums and an integer target, return indices of | |
the two numbers such that they add up to target. | |
You may assume that each input would have exactly one solution, and you |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function bubbleSort() { | |
a = [33, 2, 3345, 34456456, 3, 3434, 41, 314, 34, 34445] | |
for (var i = 0; i < a.length; i++) { | |
var swapped = false | |
for (var j = 0; j < a.length - 1; j++) { | |
if (a[j] > a[j+1]) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function isThereEquivalent(equivalentsArr, value) { | |
try { | |
var equivalent = Object.entries(equivalentsArr).find(([key]) => key === value.toString())[1] | |
return equivalent | |
} | |
catch (e) { | |
if (e instanceof TypeError) { | |
return false | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
author Oleg Kornilov | |
kornilovoy@gmail.com, https://github.com/OlegKorn | |
*/ | |
var intToRoman = function(num) { | |
var equivalents = { | |
1: "I", | |
4: "IV", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
numDeclClass = "first b-list__table-col_name_name_gtd" | |
for (i=0; i<classes.length; i++) { | |
declNum = classes[i].textContent.trim() | |
console.log(declNum) | |
} | |
console.log("num of № декларации is: ", classes.length) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
a = '''<a href="dfsdfdsfd" target="_blank" class="_1rehek"> | |
сайт-сайт.рф</a> | |
</a>ваываыва4333.РФ | |
<div>www.dekorm.com</div> | |
https://wewefds.net | |
http://dsdfsdfs.org | |
www.fsdsdfsd.РФ | |
сайт.тест | |
сайт.домен | |
''' |