Skip to content

Instantly share code, notes, and snippets.

View Jrichcrick's full-sized avatar
💯

Jilly Richcrick Jrichcrick

💯
View GitHub Profile
# web-scraping wide receiver data
# Imports pandas, requests, and bs4 packages and creates a soup object from the url request response
import pandas as pd
import requests
from bs4 import BeautifulSoup
URL = "https://www.fantasypros.com/nfl/stats/wr.php"
r = requests.get(URL)
@Jrichcrick
Jrichcrick / RecreationalSpot.java
Created February 12, 2021 18:57
Geeky Buildings solution
import java.util.Stack;
public class RecreationalSpot {
class Solution{
}
static boolean recreationalSpot(int[] arr , int n) {
Stack<Integer> b1 = new Stack<>();
Stack<Integer> b2 = new Stack<>();
@Jrichcrick
Jrichcrick / RepeatedString.java
Created January 31, 2021 23:44
HackerRank Repeated String solution
public class RepeatedString {
static long repeatedString(String s, long n) {
long x = n / s.length();
long remainder = n % s.length();
long numAs = 0;
long remainderAs = 0;
for (int i = 0; i < s.length(); i++) {
if (s.charAt(i) == 'a')
@Jrichcrick
Jrichcrick / gameOfThrones.java
Created January 22, 2021 00:35
HackerRank GoT solution 1. might be able to be optimized
import java.io.*;
import java.math.*;
import java.security.*;
import java.text.*;
import java.util.*;
import java.util.concurrent.*;
import java.util.regex.*;
public class GameOfThrones {
@Jrichcrick
Jrichcrick / Checker.java
Created January 19, 2021 17:26
Sorting Comparator HackerRank solution
class Checker implements Comparator<Player> {
// complete this method
//descending by score, then ascending by name
public int compare(Player a, Player b) {
if(a.score == b.score) {
return a.name.compareTo(b.name);
}
return b.score - a.score;
@Jrichcrick
Jrichcrick / TwoStrings.java
Last active January 18, 2021 21:25
TwoStrings HackerRank solution 2 ways
import java.util.*;
import java.util.Map;
public class TwoStrings {
// Didn't pass test case 4 and 5. nto sure why
static String twoStrings1(String s1, String s2) {
char[] c1 = s1.trim().toCharArray();
char[] c2 = s2.trim().toCharArray();
for(int i = 0; i < c1.length; i++) {
@Jrichcrick
Jrichcrick / rotLeft.java
Created January 18, 2021 00:41
Array Left Rotation
static int[] rotLeft(int[] a, int d) {
int size = a.length;
int[] b = new int[size];
/* 1 2 3 4 5 6
* 2 3 4 5 6 1
* 3 4 5 6 1 2
* 4 5 6 1 2 3
*
* 5 6 1 2 3 4
@Jrichcrick
Jrichcrick / hasCycle.java
Created January 17, 2021 23:26
Linked List cycle detection; Floyd's Algorithim
boolean hasCycle(Node head) {
if(head == null) return false;
Node slow = head;
Node fast = head.next;
while(slow.next != null && fast.next != null){
if(slow == fast)
return true;
slow = slow.next;
fast = fast.next.next;
@Jrichcrick
Jrichcrick / AsciiLoop.java
Last active January 14, 2021 02:48
convert a string to a char array and back again
import java.io.*;
import java.util.*;
public class AsciiLoop {
public AsciiLoop() {
}
private int index;