Skip to content

Instantly share code, notes, and snippets.

View 201901551-ctrl's full-sized avatar

201901551-ctrl

  • Joined Sep 29, 2025
View GitHub Profile
class Student {
final String name;
final int id;
final List<String> enrolledCourses;
Student({required this.name, required this.id, List<String>? initialCourses})
: enrolledCourses = initialCourses ?? [];
void enrollInCourse(String course) {
void main() {
List<dynamic> fizzbuzzOutputList = [];
for (int i = 1; i <= 100; i++) {
final bool divisibleBy3 = i % 3 == 0;
final bool divisibleBy5 = i % 5 == 0;
String? output;
int romanToInt(String s) {
Map<String, int> romanMap = {
'I': 1,
'V': 5,
'X': 10,
'L': 50,
'C': 100,
'D': 500,
'M': 1000,
};
List<List<int>> generatePascalsTriangle(int numRows) {
if (numRows <= 0) return [];
List<List<int>> triangle = [[1]];
for (int i = 1; i < numRows; i++) {
List<int> prevRow = triangle[i - 1];
List<int> row = [1];
for (int j = 1; j < i; j++) {