Skip to content

Instantly share code, notes, and snippets.

View yesidays's full-sized avatar
🎯
Focusing

Yesi yesidays

🎯
Focusing
View GitHub Profile
@yesidays
yesidays / burbuja.c
Created July 16, 2012 10:01
Método de burbuja
#include <stdio.h>
#define MAX 100
int main() {
int total;
int vNumeros[MAX];
int j, i, temp;
printf ("Cuantos numeros deseas ordenar? ");
scanf("%d", &total);
@yesidays
yesidays / .htaccess
Created March 17, 2012 19:42
htaccess para eliminar index.php en Codeigniter
RewriteEngine on
RewriteCond $1 !^(index\.php|images|php|script|styles|js|css)
RewriteRule ^(.*)$ /index.php/$1 [L]
@yesidays
yesidays / test.py
Created May 3, 2012 05:28
Primeros pasos Python
print "Hola Mundo"
#Numeros hexadecimales anteponiendo 0x
hexa = 0xA
print hexa
#Numeros octales anteponiendo un 0
octal = 010
print octal
@yesidays
yesidays / decBin.c
Created July 16, 2012 10:17
Decimal a binario
/* Conversión de número decimal a número binario */
#include <stdio.h>
int main() {
int n, c, k;
printf("Ingresa el número decimal: ");
scanf("%d", &n);
@yesidays
yesidays / last-stone-weight.py
Created April 12, 2020 18:05
Last Stone Weight
#https://leetcode.com/explore/challenge/card/30-day-leetcoding-challenge/529/week-2/3297/
class Solution(object):
def lastStoneWeight(self, stones):
"""
:type stones: List[int]
:rtype: int
"""
while len(stones) > 1:
stones.sort()
new_value = stones.pop() - stones.pop()
@yesidays
yesidays / backspace-string-compare.py
Last active April 10, 2020 16:23
Backspace String Compare
class Solution(object):
def backspaceCompare(self, S, T):
"""
:type S: str
:type T: str
:rtype: bool
"""
def deleteBackspace(word):
temporal = []
@yesidays
yesidays / middle-linked.py
Created April 9, 2020 00:07
Middle of the Linked List
#https://leetcode.com/explore/challenge/card/30-day-leetcoding-challenge/529/week-2/3290/
class Solution(object):
def middleNode(self, head):
"""
:type head: ListNode
:rtype: ListNode
"""
middle = head
@yesidays
yesidays / counting-elements.py
Created April 7, 2020 17:39
Couting Elements - Leetcode
class Solution(object):
def countElements(self, arr):
"""
:type arr: List[int]
:rtype: int
"""
result = 0
for j in arr:
@yesidays
yesidays / group-anagrams.py
Created April 7, 2020 00:28
Group anagrams - Leetcode
#https://leetcode.com/explore/challenge/card/30-day-leetcoding-challenge/528/week-1/3288/
class Solution(object):
def groupAnagrams(self, strs):
"""
:type strs: List[str]
:rtype: List[List[str]]
"""
keys = {}
result = []
@yesidays
yesidays / move_zeroes.py
Created April 5, 2020 02:12
Move zeroes - Leetcode
class Solution(object):
def moveZeroes(self, nums):
"""
:type nums: List[int]
:rtype: None Do not return anything, modify nums in-place instead.
"""
count = 0
for i, num in enumerate(nums):
if num == 0: