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
#include <stdio.h> | |
int maxLength(int a_size, int* a, int k) { | |
int sum = a[0], i, ini=0, sol=0, s; | |
for (i=1;i<a_size;i++) { | |
sum += a[i]; | |
while(sum > k && ini < i) { | |
sum -= a[ini]; | |
ini++; | |
} |
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
#include <stdio.h> | |
#include <limits.h> | |
int isPalind(char c) { | |
int a[CHAR_BIT]; | |
for(int i=0;i<CHAR_BIT;i++) { | |
a[i] = (c >> i) & 1; | |
} | |
for (int i=0;i<5;i++) { | |
if (a[i] != a[7-i]) { |
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
//@ympons - https://play.golang.org/p/mNEabcyTVa | |
package main | |
import "fmt" | |
type Node struct { | |
data int | |
next *Node | |
} |
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
//@ympons | |
// Reverse Linked List | |
package main | |
import "fmt" | |
type Node struct { | |
value int | |
next *Node | |
} |
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
//@ympons | |
trait Runnable { | |
fn run(&mut self); | |
} | |
struct Engine { | |
source: Vec<char>, | |
ip: usize, | |
tape: Vec<u8>, | |
p: usize, |
NewerOlder