Skip to content

Instantly share code, notes, and snippets.

😬
Happy

Arun Yokesh yokesharun

😬
Happy
Block or report user

Report or block yokesharun

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@yokesharun
yokesharun / LED_tower.ino
Created Jun 10, 2019
Arduino LED Tower Code
View LED_tower.ino
#include <FastLED.h>
/** BASIC CONFIGURATION **/
//The amount of LEDs in the setup
#define NUM_LEDS 200
//The pin that controls the LEDs
#define LED_PIN 6
//The pin that we read sensor values form
#define ANALOG_READ 2
@yokesharun
yokesharun / sortByHeight.js
Created Jul 27, 2018
sortByHeight - CodeFights | CodeSignal
View sortByHeight.js
function sortByHeight(a) {
var newArray = [];
var heights = [];
for(var i = 0; i < a.length; i++) {
if(a[i] === -1) {
newArray.push(i);
} else {
heights.push(a[i]);
}
}
@yokesharun
yokesharun / isLucky.js
Created Jul 27, 2018
isLucky - CodeFights | Codesignal
View isLucky.js
function isLucky(n) {
var allNumber = n.toString(); first_half = 0; second_half = 0;
var mid_element = allNumber.length/2 - 1;
for(i=0; i<= allNumber.length - 1; i++ ){
if(i <= mid_element){
console.log("f "+allNumber[i]);
first_half += parseInt(allNumber[i]);
}else{
console.log("s "+allNumber[i]);
second_half += parseInt(allNumber[i]);
@yokesharun
yokesharun / commonCharacterCount.js
Created Jul 27, 2018
commonCharacterCount codefights | codesignal
View commonCharacterCount.js
function commonCharacterCount(s1, s2) {
var string1 = s1.split('');
var string2 = s2.split('');
var commonCharacter=0;
for(var i=0;i<string1.length;i++){
if(string2.indexOf(string1[i])>=0){
commonCharacter++;
string2.splice(string2.indexOf(string1[i]),1);
}
@yokesharun
yokesharun / allLongestStrings-codefights.js
Created Jul 27, 2018
allLongestStrings - CodeFights | codesignal
View allLongestStrings-codefights.js
function allLongestStrings(inputArray) {
var result=[""];
var count=0;
for(var i=0;i<inputArray.length;i++){
if(inputArray[i].length>=result[result.length-1].length){
if(inputArray[i].length>result[result.length-1].length){
count=1;
}else{
count++
}
@yokesharun
yokesharun / incorrectPasscodeAttempts-CodeFights.js
Created Jul 27, 2018
incorrectPasscodeAttempts Codefights | codesignal
View incorrectPasscodeAttempts-CodeFights.js
function incorrectPasscodeAttempts(passcode, attempts) {
var cnt = 0
for(a in attempts){
let failed = false;
if(attempts[a]!==passcode){
cnt++;
failed = true
}
console.log(cnt);
@yokesharun
yokesharun / React-State-Props-Manipulation.js
Created Jul 6, 2018
React State and props Initialisation and manupulation
View React-State-Props-Manipulation.js
// Define a state
this.state = {
name: "Jon Snow",
age: 28
}
// get value of the state
this.state.name
@yokesharun
yokesharun / React-Parent-Child-Component.js
Last active Feb 15, 2019
A Simple Example of React Parent - Child Component
View React-Parent-Child-Component.js
import React, { Component } from 'react';
Class ParentComponent extends Component{
this.state = {
title: "CodeFights",
description: "Online website"
}
constructor(props){
super(props);
}
@yokesharun
yokesharun / add-codefights.js
Created Jun 27, 2018
Code Fights Challenges - add, centuryFromYear, checkPalindrome, adjacentElementsProduct, shapeArea, makeArrayConsecutive2
View add-codefights.js
function add(param1, param2) {
return param1 + param2;
}
View Blockstack.txt
Verifying my Blockstack ID is secured with the address 1F2BFT4XPMyUJ4wzNNnk2717a3nVZQch32 https://explorer.blockstack.org/address/1F2BFT4XPMyUJ4wzNNnk2717a3nVZQch32
You can’t perform that action at this time.