Challenge 2: State and Recomposition — Solution @Composable fun Counter() { var count by remember { mutableStateOf(0) } Column(modifier = Modifier.padding(16.dp)) { Text(text = "Count: $count", fontSize = 20.sp) Row { Button(onClick = { count-- }) { Text("-") } Spacer(modifier = Modifier.width(8.dp)) Button(onClick = { count++ }) { Text("+") } } } } @Preview(showBackground = true) @Composable fun CounterPreview() { Counter() } Notes: - var count by remember { mutableStateOf(0) } uses property delegation (Kotlin Intermediate Chapter 4) — count can be read and reassigned like a normal var (count++, count--), while Compose secretly tracks every place that reads it. - Tapping either Button runs its onClick lambda, which reassigns count. Compose then automatically recomposes the Text(text = "Count: $count") line specifically, since it's the composable that reads count — the Buttons and Row structure themselves don't need to re-run. - remember { } (without rememberSaveable) means count resets to 0 if the Activity is recreated (e.g. on rotation, per Course 1 Chapter 2) — rememberSaveable is the variant that survives that, mentioned in the chapter but not required for this challenge.