Skip to content

Instantly share code, notes, and snippets.

View ulvimemmeedov's full-sized avatar
:octocat:
Focusing

Ulvi Memmedov ulvimemmeedov

:octocat:
Focusing
View GitHub Profile
const arr = [[[1, 2], 3], [4], [5, 6], [7, [8, 9]]];
const convertFlat = (arr = []) => arr.flat(Infinity);
const convertFlatSome = (arr = []) =>
arr.some(Array.isArray) ? convertFlatSome(arr.flat(1)) : arr;
const convertFlatToStringMap = (arr = []) =>
arr.toString("").split(",").map(Number);

UB Stack

  • Programing languages and framework
    • NodeJs
    • JavaScript/TypeScript
    • Express.js
  • Database
    • Amazon s3
  • Services
  • Amazon Kinesis
let arr = [
[1, 2, 3],
[4, 5, 6],
[9, 8, 9],
];
let firstSum = 0,secondSum = 0;
for (let i = 0; i < arr.length; i++) {
firstSum +=arr[i][i];
}
function binarySearch(score, ranked,start = 0,end = ranked.length - 1) {
while (true){
let mid = Math.floor((start + end) / 2);
if (ranked[mid] === score)
return mid + 1;
else if (ranked[mid] > score && ranked[mid + 1] < score)
return mid + 2;
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
struct triangle
{
int a,b,c;
};
typedef struct triangle triangle;
#include <stdio.h>
#include <stdlib.h>
#define MAX_HEIGHT 41
struct box
{
int length, width, height;
};