Updated 1G4

made code prettier and added solution for 1G4