Skip to main content

Posts

find the sum of 3 numbers to find next term

This Blog post Describe How to your may find this algorithm else where too. In this Problem Algorithm: We are given a three digits of sequence after that,we need to find the next element in the array,for Example :- [0,2,4] By suming the previous Three Elements,means [0+2+4]=next_term Hence the next term in the array is 6.Now the array is [0,2,4,6]. Intution: Here are the few conditions return mod value of the following sequence. Every time return the sum of last three numbers. def find_nth_term (n) : mod = 10 ** 9 + 7 if n<= 3 : return sequence[n- 1 ] for i in range( 4 ,n+ 1 ): next_term=sequence[- 1 ]+sequence[- 2 ]+sequence[- 3 ]%mod sequence.append(next_term) return sequence[- 1 ] n=int(input()) #Ouput the nth term modulo (10**9+7) result=find_nth_term(n) print(result)
Recent posts

gradlew flutter

Error signing Expert PS C:\Users\Administrator\Documents\collarlink-1\android> .\gradlew signingReport FAILURE: Build failed with an exception. * Where: Build file 'C:\Users\Administrator\Documents\collarlink-1\android\app\build.gradle' line: 2 * What went wrong: An exception occurred applying plugin request [id: 'com.android.application'] > Failed to apply plugin 'com.android.internal.application'.    > Android Gradle plugin requires Java 11 to run. You are currently using Java 1.8.       Your current JDK is located in C:\Program Files\Java\jdk1.8.0_191\jre       You can try some of the following options:        - changing the IDE settings.        - changing the JAVA_HOME environment variable.        - changing `org.gradle.java.home` in `gradle.properties`. * Try: > Run with --stacktrace option to get the stack trace. > Run with --info or --debug option to get more log output. > Run with --scan to get full insights. * Get more help at https:/

how to make a google signin in flutter

 In this article I will describe how  add a simple google sign  button in your flutter project. Here the Steps to make a Google Signin: St go to your  flutter project folder and then run  Run   ./android/gradlew signingReport    Just Cool Down
 Error Message lib/widgets/widgets.dart:1:8: Error: Dart library 'dart:js' is not available on this platform. import 'dart:js';        ^ Context: The unavailable library 'dart:js' is imported through these packages:     package:collarlink => dart:js Detailed import paths for (some of) the these imports:     package:collarlink/main.dart => package:collarlink/screens/profile_screen.dart => package:collarlink/widgets/widgets.dart => dart:js When This Error Occured 

Flutter MultiDex Application Error

Error Message Multidex support is required for your android app to build since the number of methods has exceeded 64k.  See https://docs.flutter.dev/deployment/android#enabling-multidex-support space-collapse: preserve;"> for more information.   You may pass the --no-multidex flag to skip Flutter's multidex support to use a manual solution.Flutter tool can add multidex support. The following file will be added by flutter: /app/src/main/java/io/flutter/app/FlutterMultiDexApplication.java cannot prompt without a terminal ui  Error: Gradle task assembleDebug failed with exit code 1 When This Message Occured This Message I got when i was running flutter firebase application. Solution The Problem is About MultiDesk support while running your flutter Application.The solution is simple: Steps: If your are running your Application in VSCODE and running your Application in Debug console .or Using key button `F5` . Open Normal Terminal Run command `flutter run` in your Applicati

Understanding Interfaces in TypeScript

Designing Blueprints for Object Structure In the realm of TypeScript, interfaces serve as indispensable tools for defining blueprints of object structures. They act as contracts that classes and objects must adhere to, ensuring consistency and type safety throughout development. This guide delves into the key concepts and benefits of interfaces, empowering you to write more robust and maintainable TypeScript code. Key Concepts Defining Interfaces: Use the  interface  keyword to create a structural template. Specify required properties and their types. Optionally include methods and their signatures. Explain interface Person { firstName: string ; lastName: string ; age: number ; } Implementing Interfaces: Classes adopt interfaces using the  implements  keyword. Ensure class members align with interface specifications. class Student implements Person { // ... class implementation } Enforcing Structure: Type checking guarantees objects adhere to interface contracts. Catching p

Unhandled Exception: PlatformException(channel-error, Unable to establish connection on channel., null, null)

Hey Friend,  This article is about how to resolve the issue of `  Unhandled Exception: PlatformException(channel-error, Unable to establish connection on channel., null, null)` . In this article i will describe in breifly how to resolve this issue while running flutter. When did I got this Error: This is my issue which i was running linux desktop app. In my case firebase_core dependency was not working  1st Method : What worked for me I was building my project for linux Desktop App ,Now instread I  run my app for both Android and web My app and it worked fine for my case. My Advise , Run your app on other Platforms too. 2nd Method : As the Error is due to dependency try to clean your project and allow to rebuild your app from base of your project. Here is my issue which I have rose in github: https://github.com/firebase/flutterfire/discussions/12077 commands you can use are  Conclusion: While building your First Flutter project.These are tiny errors to get known about the errors .This