Posts

Showing posts from April, 2023

Strict mode in JavaScript programming

Strict mode in JavaScript   Strict mode in JavaScript is a way to enforce stricter rules and restrictions when writing JavaScript code, which can help identify and prevent potential errors, security leaks, or performance issues. It is enabled by adding the following line at the beginning of a script or a function: "use strict"; When strict mode is enabled, the JavaScript interpreter will throw errors or disallow certain actions that are allowed in non-strict mode. Some examples of changes in strict mode include: 1. Variables must be declared with var , let , or const before being used, otherwise an error is thrown. Non-strict mode: x = 10; // No error, even though 'x' is not declared console.log(x); // 10 Strict mode: "use strict"; x = 10; // Error: x is not defined console.log(x); 2. Assigning a value to an undeclared variable, read-only property, or non-writable global variable will throw an error. Non-strict mode: NaN = "not a number"; /...

Way Too Long Words - Codeforces problem solution

 Way Too Long Words - Codeforces problem solution  A. Way Too Long Words Sometimes some words like "localization" or "internationalization" are so long that writing them many times in one text is quite tiresome. Let's consider a word too long, if its length is strictly more than 10 characters. All too long words should be replaced with a special abbreviation. This abbreviation is made like this: we write down the first and the last letter of a word and between them we write the number of letters between the first and the last letters. That number is in decimal system and doesn't contain any leading zeroes. Thus, "localization" will be spelt as "l10n", and "internationalization» will be spelt as "i18n". You are suggested to automatize the process of changing the words with abbreviations. At that all too long words should be replaced by the abbreviation and the words that are not too long should not undergo any changes. Input...

University Questions - 1st semester

Image
City University, Bangladesh  1st Semester Question Mid-term CSE 111 ENG 101 PHY 101 Final ENG 201 PHY 201 CSE 112

Way Too Long Words - Codeforces problem solution

Way Too Long Words - Codeforces problem solution   A. Way Too Long Words Sometimes some words like " localization " or " internationalization " are so long that writing them many times in one text is quite tiresome. Let's consider a word  too long , if its length is  strictly more  than  10  characters. All too long words should be replaced with a special abbreviation. This abbreviation is made like this: we write down the first and the last letter of a word and between them we write the number of letters between the first and the last letters. That number is in decimal system and doesn't contain any leading zeroes. Thus, " localization " will be spelt as " l10n ", and " internationalization » will be spelt as " i18n ". You are suggested to automatize the process of changing the words with abbreviations. At that all too long words should be replaced by the abbreviation and the words that are not too long should not undergo ...

[GYM] 100 Easy Problems (Bootcamp)

  [GYM] 100 Easy Problems (Bootcamp) Target audience: newbies and pupils (rating up to 1400). Group link:  https://codeforces.com/group/yg7WhsFsAp/contests  (hit "join" on the right). Hi. Enjoy a series of 8 problem lists for beginners. The example topics are strings, arrays, math, and binary search. You are allowed to discuss anything with others, or just look up solutions online. There are also 3 exams, each recommended for a 2-hour individual virtual participation. Use the displayed order, e.g. take exam 1 after day 3. It all should take you 2 weeks of intense bootcamp-like work (or a few months if you take your time). The problems were originally used two years ago in a Saudi Arabia camp. It's a mix of around 70 existing CF problems and 30 new original problems, mainly prepared by  kostka , with some help from me and  mustafabar . I asked them for permission to publish everything. I will put hints to some problems in this blog (or in the group? not sure). Ex...

Popular posts from this blog

Whiteboarding Interviews

Version Control with Git: A Beginner’s Guide

Callback function in JavaScript