Monday, August 19, 2024

 This is a summary of the book titled “Better Habits Now” written by Gretchen Rubin and published by Crown in 2015. It helps us to master the habits of our everyday lives. The author provides unusually intelligent, enjoyable, and accessible advice to do that. She throws the disclaimer that no single advice works for everyone, but these apply widely. 

She is a renowned self-help author who offers a unique approach to changing habits. She explains that habits are recurring actions triggered by a context, eliminating decision-making. Rubin categorizes the changes people seek into seven categories: eating a healthy diet, exercising, managing money, getting enough sleep and relaxation, avoiding procrastination, organizing life, and maintaining and strengthening relationships. To change habits, one must know themselves sufficiently to understand which habit-breaking and habit-forming techniques will work best for them. Rubin emphasizes dealing with internal and external expectations. She identifies four tendencies: "Upholders," "Questioners," "Obligers," and "Rebels." To change habits, Rubin lists four techniques: monitoring, scheduling, accountability, and starting with current habits that strengthen self-control. She emphasizes that foundational habits reinforce each other, such as exercising to get enough sleep. Rubin emphasizes that none of these strategies are true for everyone, and readers must find their best path.

Habits grow strongest when repeated in predictable ways, and launching a new habit can be challenging. Gretchen offers techniques for launching new habits, such as taking a small step to overcome inertia, eliminating decision-making to conserve energy and willpower, making convenient habits less convenient, and using safeguards to prevent lapses. Monitoring activities helps identify areas for improvement. Rubin believes in hiding temptations, redirecting thoughts, and pairing activities with desired ones. Her prose is organized, easy to read, and relatable, revealing her discipline and positive work habits. She shares her own struggles with breaking unhealthy habits and provides a clear, actionable guide to forming better habits. Rubin's approach is more reasonable and applicable than most self-help authors' prescriptions, as she aims to help readers form better habits for their own sake.

#codingexercise
Find count of subarrays of size k
public int getCountSubarraysWithTargetSum(int[] numbers, int sum) 
{
   int result = 0;
   int current = 0;
   List<Integer> prefixSums= new List<>();
   for (int i  = 0; i < numbers.length; i++) {
      current += numbers[i];
     if (current == sum) {
         result++;
     }
     if (prefixSums.indexOf(current-sum) != -1)
          result++;
     }
    prefixSum.add(current);
   }
   return result;
}

No comments:

Post a Comment