Skip to content

Instantly share code, notes, and snippets.

View KakoozaJerry's full-sized avatar
🎯
Focusing

KakoozaJerry

🎯
Focusing
View GitHub Profile
/**
* @param {number[]} nums1
* @param {number[]} nums2
* @return {number}
*/
let totals = (garray) => {
let count = 0;
for (let i=0; i < garray.length; i++){
let result = garray[i];
function countDuplicates(numbers){
//[1,1,1,2,3,3,4,5,6]
//[1,3,1,4,5,1,6,3,2]
numbers.sort((a,b) => a - b)
// sort the array
let count = 0
let left = 0
let right = 1
//loop through numbers
while (right < numbers.length){
var numbers = [1,3,3,4,4,4]
function countDuplicate(numbers){
//write your code here
//var result = {}
var result = {}
numbers.forEach(function(x){
result[x] = (result[x] || 0) + 1;
});
numbers.filter((item,x)=>numbers.indexOf(item)==x)
const firstArray = [4, 9, 5];
const secondArray = [9,4,9,8,4];
let intersection = firstArray.filter((el) => { return secondArray.includes(el); });
console.log(intersection)
theBoard = {'7': ' ' , '8': ' ' , '9': ' ' ,
'4': ' ' , '5': ' ' , '6': ' ' ,
'1': ' ' , '2': ' ' , '3': ' ' }
board_keys = []
for key in theBoard:
board_keys.append(key)
# 1 - Import library
import pygame
from pygame.locals import *
import math
import random
# 2 - Initialize the game
pygame.init()
width, height = 640, 480
screen=pygame.display.set_mode((width, height))