This file contains hidden or 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
let fibonacci = ( n , dict ) =>{ | |
if ( dict[n] ){ | |
return dict[n]; | |
} | |
if ( n <= 1 ){ | |
return 1; | |
} |
This file contains hidden or 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
/* get total number of followers*/ | |
SELECT PERSON_ID, COUNT(*) AS NUM_FOLLOWERS | |
FROM FOLLOWERS | |
GROUP BY PERSON_ID order by PERSON_ID asc; | |
/* test query above*/ | |
select * from FOLLOWERS where PERSON_ID =1 ORDER BY FOLLOWER_PERSON_ID ASC; | |
This file contains hidden or 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
package com.experis.cisco.test.ExperisCisco; | |
public class ExperisTest | |
{ | |
public static void main( String[] args ) | |
{ | |
String testStr = "race car"; | |
ExperisTest test = new ExperisTest(); | |
boolean isPalindrome = test.isPalindrome(testStr); |
This file contains hidden or 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 Curried Function | |
* | |
* Create a function called "houseBuilder" that should: | |
* - Accept the number of stories (floors) | |
* - Return a function | |
* | |
* The returned function should: | |
* - Accept the color of the house | |
* - Return a string in the following format: | |
* "building a <numOfStories>-story, <color> house" |
This file contains hidden or 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
/* Create A Reducer | |
* | |
* You need to create a reducer called "appReducer" that accepts two arguments: | |
* - First, an array containing information about ice cream | |
* - Second, an object with a 'DELETE_FLAVOR' `type` key | |
* (i.e., the object contains information to delete the flavor from the state) | |
* | |
* The action your reducer will receive will look like this: | |
* { type: 'DELETE_FLAVOR', flavor: 'Vanilla' } | |
* |
This file contains hidden or 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
/* Popular Ice Cream Totals Quiz | |
* | |
* Using the data array and .reduce(): | |
* - Return an object where each property is the name of an ice cream flavor | |
* and each value is an integer that's the total count of that flavor | |
* - Store the returned data in a new iceCreamTotals variable | |
* | |
* Notes: | |
* - Do not delete the data variable | |
* - Do not alter any of the data content |
This file contains hidden or 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
class Pramp { | |
public static void main(String[] args) { | |
String doc = "practice makes perfect. get perfect by practice. just practice!"; | |
Pramp solution = new Pramp(); | |
List<Ocurrence> ocurrences = solution.process(doc); | |
//testing | |
//unique , counts, sort descending order |
This file contains hidden or 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
// Class name must be "Main" | |
import java.util.Arrays; | |
class Main { | |
/** | |
Given an array and a value, remove all instances of that value in place and return the new length. | |
Do not allocate extra space for another array, you must do this in place with constant memory. |
This file contains hidden or 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
package com.zola.leetcode; | |
import java.util.ArrayList; | |
import java.util.Arrays; | |
import java.util.List; | |
import java.util.Stack; | |
public class Solution20 { | |
public static void main(String[] args) { |
This file contains hidden or 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
package com.zola.algorithms; | |
import java.util.HashMap; | |
public class LRUCache{ | |
public static void main(String... args){ | |
LRUCache cache = new LRUCache( 2 /* capacity */ ); |