Skip to content

Instantly share code, notes, and snippets.

View EmmaG2's full-sized avatar
🍬
I'm going to upload things in python (or java)

Emma Granados EmmaG2

🍬
I'm going to upload things in python (or java)
View GitHub Profile
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Cursos gratis de programacion</title>
</head>
<body>
<section>
@EmmaG2
EmmaG2 / Lista.java
Last active July 6, 2022 00:13
Refactorización de la función, eliminarNodo()
public boolean eliminarNodo(int elem) {
if (estaVacia()) return false;
if (inicio == fin && elem == inicio.dato) {
inicio = fin = null;
return true;
}
if (elem == inicio.dato) {
nombres = input("Ingresa los nombres, separados por coma: ").split(",")
nombre_a_buscar = input("Ingresa el nombre a buscar: ")
def buscar_nombre(nombre_buscar):
if any(nombre == nombre_buscar for nombre in nombres):
return f"nombre encontrado {nombre_buscar}"
return f"No se encontro el nombre {nombre_buscar}"
print(buscar_nombre(nombre_a_buscar))
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
float[] notes = new float[3];
String name;
Scanner scann = new Scanner(System.in);
System.out.println("Ingrese el nombre del alumno");
'use strict';
const testArray = [1, 'hello', 2, 'world']
const onlyStrings = []
testArray
.filter(n => typeof n === 'string')
.map(n => onlyStrings.push(n))
console.log(onlyStrings)

Challengue of HackerRank

This is my solution for the challengue "if/else", I'm not a bigger fan of this sentence, so... I coded my solution only using ifs and creating a function validator.

import java.util.Scanner;
public class Main {
public static Scanner sc = new Scanner(System.in);
public static void main(String[] args) {
System.out.println(mensajesOpcionales());
}
---
BasedOnStyle: Microsoft
AlignAfterOpenBracket: Align
AlignConsecutiveMacros: "true"
AlignConsecutiveAssignments: "true"
AlignConsecutiveDeclarations: "true"
AlignEscapedNewlines: Left
AlignOperands: "true"
AlignTrailingComments: "true"
AllowAllArgumentsOnNextLine: "true"

Interesting codes

This is a gist of the interesting codes in the watermelon challengue

package com.challenges.graphs;
public class Arista implements Comparable<Arista> {
private final Vertice vertice1;
private final Vertice vertice2;
private int peso;
public Arista(Vertice vertice1, Vertice vertice2) {
this(vertice1, vertice2, 1);
}