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
| max_days = {} | |
| for d in list2: # or list1, works the same | |
| day, month = int(d[:2]), d[2:] | |
| if month not in max_days or day > max_days[month]: | |
| max_days[month] = day | |
| result = [f"{value:02}{key}" for key,value in max_days.items()] | |
| print(f">>> {result}") |
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
| import java.util.*; | |
| import java.io.*; | |
| public class Foo { | |
| public static void main(String[] args) throws Exception{ | |
| RandomAccessFile input1 = new RandomAccessFile("c:\\temp\\Foo.java", "rw"); | |
| System.out.println("1" + read(input1)); | |
| DataInputStream input2 = new DataInputStream(new FileInputStream("c:\\temp\\Foo.java")); | |
| System.out.println("2" + read(input2)); | |
| } |