DP 52. Evaluate Boolean Expression to True | Partition DP

Поделиться
HTML-код
  • Опубликовано: 2 май 2022
  • Lecture Notes/C++/Java Codes: takeuforward.org/dynamic-prog...
    Problem Link: bit.ly/32tAMUW
    Please watch the video at 1.25x for a better experience.
    Pre-req for this Series: • Re 1. Introduction to ...
    a
    Make sure to join our telegram group for discussions: linktr.ee/takeUforward
    Full Playlist: • Striver's Dynamic Prog...
    In this video, we solve the question evaluate boolean expression to true.
    If you have not yet checked our SDE sheet, you should definitely do it: takeuforward.org/interviews/s...
    You can also get in touch with me at my social handles: linktr.ee/takeUforward

Комментарии • 302

  • @trojanhorse8278
    @trojanhorse8278 Год назад +213

    I personally think that all these variations of partition category are non trivial and hard to come up with the solution on our own but once we learn them all then further problems can be mapped into on these 5-6 problems. So if anyone reading this, don't get demotivated if you had seen MCM problem solution and tried this on your own but couldn't solve it. I spent 2 hrs but wasn't able to come up with the solution. Just watch all these 5-6 videos on partition pattern and , you'll feel confident on this pattern.

    • @akashsahu2571
      @akashsahu2571 Год назад +12

      I dont disagree

    • @Deadinside567
      @Deadinside567 11 месяцев назад

      ​@@akashsahu2571what's you opinion

    • @user-xz5iw1wf9w
      @user-xz5iw1wf9w 8 месяцев назад +6

      its like we are byhearting the concepts

    • @tasneemayham974
      @tasneemayham974 8 месяцев назад +3

      Yes!! Thank you for the encouragement. I think that this pattern in dp is actually the hardest to grasp. But I think that makes it all the more interesting and challenging!!

    • @RishikaBoinapally
      @RishikaBoinapally 4 месяца назад +3

      thnxx.needed this

  • @pulkitranjan8189
    @pulkitranjan8189 2 года назад +58

    I did knew MCM but it was not at all a cake walk

  • @sauravchandra10
    @sauravchandra10 5 месяцев назад +11

    Watching this again after 8 months, and I had entirely forgotten how to solve this one. Thanks again for making it clear!

  • @sharmilasiram5438
    @sharmilasiram5438 2 месяца назад +16

    The linked leetcode problem is incorrect and as coding ninjas link is removed I think you should fix this.........and bro mcm is hard, remaining patterns I was able to do on my own after 1 or 2 prblms, but this 🤯

  • @nilimsankarbora5911
    @nilimsankarbora5911 6 месяцев назад +3

    The way of thinking its recursion aproach is beyond my imagination! GreatWork! US!

  • @gauravgupta7280
    @gauravgupta7280 2 года назад +66

    Here's the Tabulation Code which is running absolutely fine in Coding Ninjas:
    #define ll long long int
    ll mod=1000000007;
    int evaluateExp(string & exp) {
    int n=exp.length();
    vector dp(n,vector(n,vector(2,0)));
    for(int i=n-1;i>=0;i--)
    {
    for(int j=i;j

    • @shirishprataya4602
      @shirishprataya4602 2 года назад +1

      Thanks a lot.

    • @sfg805
      @sfg805 3 месяца назад

      bro it also consider the case s[i]==operation in this our answer is wrong na?

  • @stith_pragya
    @stith_pragya 6 месяцев назад +1

    UNDERSTOOD.........Thank You So Much for this wonderful video.....🙏🏻🙏🏻🙏🏻🙏🏻🙏🏻🙏🏻

  • @iEntertainmentFunShorts
    @iEntertainmentFunShorts Год назад +27

    Striver bhaiya please add 5-8 problems Bitmask DP
    US as always ❤️

  • @taashukumar1155
    @taashukumar1155 Год назад +9

    correction:- Insted of on an operand* it's on an operator 6:40

  • @cinime
    @cinime 2 года назад +1

    Understood!! Thank you soooooo much as always!!

  • @DevashishJose
    @DevashishJose 6 месяцев назад

    Understood, Thank you so much Striver

  • @himanshudhaka5149
    @himanshudhaka5149 2 года назад +5

    I think returning pair will be easier to understand and we can use 2d dp

    • @soumabhaghosh6199
      @soumabhaghosh6199 2 года назад +3

      yes i am thinking so, if(i==j ){
      if(str[i]=='T') {
      return {1,0};
      }
      else return {0,1};
      }
      is the code ok fore base case:

    • @findingMyself.25yearsago
      @findingMyself.25yearsago Год назад +1

      @@soumabhaghosh6199 yes and below is the code
      def evaluateExp(expr):
      # Write your code here.
      dp = {}
      def dfs(i, j):
      if (i, j) in dp:
      return dp[(i, j)]
      if i > j: return 0
      if i == j:
      if expr[i] == 'T':
      return [1, 0]
      else:
      return [0, 1]
      waysTrue = 0
      waysFalse = 0
      for k in range(i + 1, j, 2):
      lt = dfs(i, k - 1)[0]
      lf = dfs(i, k - 1)[1]
      rt = dfs(k + 1, j)[0]
      rf = dfs(k + 1, j)[1]
      if expr[k] == "|":
      # if isTrue:
      waysTrue += lt * rt + lt * rf + rt * lf
      # else:
      waysFalse += lf * rf
      if expr[k] == "&":
      # if isTrue:
      waysTrue += lt * rt
      # else:
      waysFalse += lf * rf + lt * rf + rt * lf
      if expr[k] == "^":
      # if isTrue:
      waysTrue += lt * rf + lf * rt
      # else:
      waysFalse += lf * rf + lt * rt
      dp[(i, j)] = [waysTrue, waysFalse]
      return [waysTrue, waysFalse]
      return dfs(0, len(expr) - 1)[0]

  • @shriyapatil3923
    @shriyapatil3923 Месяц назад

    Thank you so much for this!! I can't imagine learning DSA without you❤

  • @Hemus212
    @Hemus212 Год назад

    Understood well!! Awesome explanation

  • @UECAshutoshKumar
    @UECAshutoshKumar 27 дней назад +1

    Thank you
    Understood!

  • @akshatgupta2607
    @akshatgupta2607 2 года назад

    Amazing work !!

  • @Hrushi_2000
    @Hrushi_2000 10 месяцев назад

    Understood. Thankyou Sir

  • @simmi641
    @simmi641 5 месяцев назад

    Thank you striver❤

  • @adityajain3664
    @adityajain3664 Год назад

    Really well explained.

  • @astronomycosmology4888
    @astronomycosmology4888 Год назад +5

    #understood
    Please add more videos to this playlist striver ,we really need them

  • @utkarshkhairnar371
    @utkarshkhairnar371 2 года назад

    Understood 😊
    Appreciate your efforts 🙏

  • @ujjalsaha428
    @ujjalsaha428 2 года назад +3

    As always "understood" ❤️

  • @TarunSharma007
    @TarunSharma007 Год назад +5

    awesome explanation as always💥💥

  • @ratinderpalsingh5909
    @ratinderpalsingh5909 Год назад

    Understood, sir. Thank you very much.

  • @amanbhadani8840
    @amanbhadani8840 2 года назад +2

    Very Nice explanation,one of the easiest lecture on partition dp.

  • @sameersahu4569
    @sameersahu4569 2 года назад

    Understood!!!Thank you

  • @Harshit126
    @Harshit126 Год назад

    Understood, thanks

  • @prabhakaran5542
    @prabhakaran5542 Месяц назад +1

    Understood ❤❤❤❤

  • @aftabalam7103
    @aftabalam7103 2 года назад

    Amazing explanation

  • @sauravchandra10
    @sauravchandra10 Год назад

    Understood, thanks!

  • @pankajmittal1002
    @pankajmittal1002 2 месяца назад

    understood!!

  • @Gg69696
    @Gg69696 Месяц назад +1

    thnx striver

  • @satendra6200
    @satendra6200 9 месяцев назад

    understood after waching the video twice or thrice....This is really a tough question

  • @rishabhagarwal8049
    @rishabhagarwal8049 Год назад

    Understood Sir, Thank you very much

  • @amanlateef7773
    @amanlateef7773 2 года назад

    "UNDERSTOOD" as always!

  • @himanshubhaware8619
    @himanshubhaware8619 2 года назад +30

    Here's the tabulation code which got me correct!
    #include
    #define ll long long
    int mod = 1000000007;
    int evaluateExp(string & exp) {
    int n= exp.size();
    vector dp(n, vector (n, vector (2, 0)));

    for(int i=0; i=0; i--){
    for(int j=i+1; j

    • @jatingarg1897
      @jatingarg1897 2 года назад +1

      Great. I also wrote the same code. Base Case was the main highlight of tabulation.

    • @shubhamprajapati5332
      @shubhamprajapati5332 Год назад

      why does j start from i+1?
      AND
      When I do _for(int j=0; jj) continue;
      This gives me wrong answer, why?

  • @sahilrepuriya3205
    @sahilrepuriya3205 3 месяца назад

    Understood💙

  • @aakashparmar560
    @aakashparmar560 2 года назад

    Just WOW!!

  • @tarunbhutani9604
    @tarunbhutani9604 Год назад

    Amazing man❤

  • @BeingEntertained
    @BeingEntertained 2 года назад +1

    why did we use a "x" in and operator

  • @resetengineering
    @resetengineering Год назад +1

    I was getting confused initially when you were saying operand instead of operator. You can add a note on video about it

  • @manasranjanmahapatra3729
    @manasranjanmahapatra3729 Год назад

    UnderStood amazing💥

  • @srinathv1412
    @srinathv1412 5 месяцев назад

    Understood !!!!!

  • @devbhattdev1607
    @devbhattdev1607 2 года назад +6

    well its pretty easy to write the try all ways wala case in terms of tabulation.
    but how to write base is getting tough.
    while iterating if i > j continue;
    and i==j copy the memoization.

    • @devbhattdev1607
      @devbhattdev1607 2 года назад

      i dont know its right or not but am getting correct answers for it

    • @ayushagarwal6439
      @ayushagarwal6439 2 года назад

      @@devbhattdev1607 it is right

    • @factfactorial632
      @factfactorial632 2 года назад +2

      yeah that's right bro
      after filling base cases sepratly , whenever encounter base case condition while filling remaining table just continue (because that one is already filled)

  • @anoopsingh8026
    @anoopsingh8026 23 дня назад

    understood

  • @KunalTambe-oy6lb
    @KunalTambe-oy6lb Год назад

    Understood!!! But mind twisting!

  • @sanjitvyas3043
    @sanjitvyas3043 9 месяцев назад

    Understood

  • @amitranjan6998
    @amitranjan6998 Год назад

    Anyone help why mod is required here , as i can see the constraints length of exp can go upto 200 ,TC: N^3 = (200)^3=(2.100)^3=8.10^6, it can be computed ,right. correct me if i am wrong.

  • @parthsalat
    @parthsalat Год назад +14

    Please add more videos to this playlist if possible 🥺

    • @parthsalat
      @parthsalat Год назад +2

      @Ayush Negi Welcome!
      Do learn notion, because it can be a life saver!

    • @taashukumar1155
      @taashukumar1155 Год назад +4

      bhai abb kya puri dp us hi se kara leag khud bhi kuch kr le

    • @parthsalat
      @parthsalat Год назад +1

      @@taashukumar1155 You are right, but he'll get paid for uploading more videos... Good for him as well as us

    • @crazyduniya128
      @crazyduniya128 11 месяцев назад

      @parthsalat kaha hai notes?

  • @sdexstarlord
    @sdexstarlord Год назад +2

    Striver please make a playlist on bit manupulation

  • @tikshavarshney213
    @tikshavarshney213 2 года назад

    Understood !

  • @yeswanthh5068
    @yeswanthh5068 Год назад +1

    Understood 😊😊😊

  • @VivekVerma-oo3dx
    @VivekVerma-oo3dx 6 месяцев назад

    able to solve if the problem will only require that is the expression evaluates to true or not
    but can't think of how to calculate number of ways it can be true

  • @Shivam-zh1zn
    @Shivam-zh1zn Год назад +2

    I came up with the solution , it took me about 1.5 hour but i did it, all thanks to striver :)

  • @MadhavGupta-fi2tu
    @MadhavGupta-fi2tu Год назад +2

    TABULATION CODE:
    #include
    int mod=1e9+7;
    #define ll long long
    int evaluateExp(string & exp) {
    int n=exp.length();
    vector dp(n,vector (n,vector (2,0)));
    for(int i=n-1;i>=0;i--){
    for(int j=0;j

  • @priyanshvatsal9791
    @priyanshvatsal9791 Год назад

    Understood 🥰

  • @harshita.awasthi
    @harshita.awasthi Год назад

    Understood !!

  • @salimansari171
    @salimansari171 Год назад

    Understood 😊😊

  • @smartswaggy6114
    @smartswaggy6114 Год назад +3

    JUST IN CASE ANYONE NEEDS THE CODE.
    int f(int i, int j, bool istrue, string &exp,vector&dp){
    if(i>j){
    return 0;
    }
    if(i==j){
    if(istrue){
    return exp[i]=='T';
    }
    else return exp[i]=='F';
    }
    if(dp[i][j][istrue]!=-1){
    return dp[i][j][istrue];
    }
    int ways=0;
    for(int k=i+1;k

  • @saimhatre89
    @saimhatre89 2 года назад

    understoood

  • @as-pn4ir
    @as-pn4ir 2 года назад

    Great

  • @anshumangupta1001
    @anshumangupta1001 Год назад

    Understood.

  • @revanthpatloori6359
    @revanthpatloori6359 9 месяцев назад

    hey struver i did'nt understand why you are mutiplying the lt lr etc

  • @factfactorial632
    @factfactorial632 2 года назад +4

    Great explanation
    but could not understand why we require to take long long because we are doing mod of 1e9+7 at every step

    • @rksmehul
      @rksmehul 2 года назад +6

      let's say,
      int x = INT_MAX;
      and
      int y = INT_MAX;
      suppose you want to do (x+y)%mod
      then x + y will already overflow and then doing modulus operation will be useless. Therefore x & y must be long long not int.

    • @chetanraghavv
      @chetanraghavv 2 года назад

      you can use modulo properties too if you don't want to use long long

  • @Hello-ro6hr
    @Hello-ro6hr 2 года назад

    UNDERSTOOD ...

  • @princekeshriabc
    @princekeshriabc 6 дней назад

    mja aaya sikh ke

  • @atanunayak6637
    @atanunayak6637 Год назад +3

    This is just for my own reference: Bhai multiply hi hoga na because dekh left mai maan le (()(())()()()) , ((()(()))(())) ye do ways hai and (()(())()()()) , ((()(()))(())), (()(())()()()) , ((()(()))(())) then har ek left ke liye 4 options hai ki true mile, so agar and rahega then 2 * 4 ways hoga!

  • @abhinavshukla6418
    @abhinavshukla6418 Год назад +1

    is it necessary to tell the tabulation approach in interviews,wont memoization wrok,?? I am kind of struggling with tabulation

    • @jewelchakraborty9717
      @jewelchakraborty9717 5 месяцев назад

      Try to write in paper what the row and column exactly mean? I used to struggle as well in base cases until I started writing them down in the paper.

  • @lakeshkumar1252
    @lakeshkumar1252 Год назад

    UNDERSTOOD

  • @parambudhadev
    @parambudhadev 16 дней назад +1

    Tabulation Code:
    int evaluateExp(string &exp) {
    vector dp(exp.size(),vector(exp.size(),vector(2,0)));
    for(int i=exp.size()-1;i>=0;i--){
    for(int j=i;j

  • @abhishekgh4572
    @abhishekgh4572 Год назад

    why do they use %mod for the result?
    I just don't get it

  • @nurulhasan2479
    @nurulhasan2479 Год назад +3

    Why do we need to consider the else case as the problem stated that boolean expressions need to be true?

    • @39_jatinjain4
      @39_jatinjain4 5 месяцев назад

      True

    • @jewelchakraborty9717
      @jewelchakraborty9717 5 месяцев назад

      left | right can be true even if one of left or right is false. That's why we need to consider the false ways as well to find out total number of ways. Thanks.

    • @ishpreetkaur5720
      @ishpreetkaur5720 4 месяца назад

      but this is not the case when we have & as an operator. left&right is true only if both of them are true then why are we considering the else case?@hakraborty9717

  • @deepakchintada6305
    @deepakchintada6305 Год назад

    **Tabulation code using striver's principles:**
    int evaluateExp(string & exp) {
    int n = exp.size();
    vector dp(n, vector (n, vector(2, 0)));
    for(int ind = 0; ind < n; ind++) {
    for(int isTrue = 0; isTrue = 0; i--) {
    for(int j = 0; j

  • @rameshpokhriyalnishank7445
    @rameshpokhriyalnishank7445 2 года назад +4

    As always "understood" ❤
    Homework code for tabulation in this ques:

    int tab(string s,int n)
    {
    vector dp(n,vector(n,{0,0}));//{true,false}

    for(int i=0,j=0;i

  • @p38_amankuldeep75
    @p38_amankuldeep75 Год назад

    understood💝🧡💝

  • @BeingEntertained
    @BeingEntertained 2 года назад

    why did we use multiply in finding no. of ways like X1 x X2

  • @akshitarastogi9280
    @akshitarastogi9280 6 месяцев назад

    The leetcode question has a slight variation.can anyone explain to me that

  • @UECAshutoshKumar
    @UECAshutoshKumar 26 дней назад +1

    *Tabulation*
    #include
    int evaluateExp(string &exp)
    {
    int n = exp.size();
    vector dp(n, vector(n, vector(2, 0)));
    for (int start = n - 1; start >= 0; start--)
    {
    for (int end = 0; end < n; end++)
    {
    for (int isTrue = 1; isTrue >= 0; isTrue--)
    {
    if (start > end)
    {
    continue;
    }
    if (start == end)
    {
    if (isTrue == 1)
    {
    dp[start][end][isTrue] = exp[start] == 'T';
    }
    else
    {
    dp[start][end][isTrue] = exp[start] == 'F';
    }
    }
    else
    {
    int MOD = 1e9 + 7;
    long long ways = 0;
    for (int k = start + 1; k

  • @aditithakur6226
    @aditithakur6226 Год назад

    Understood Sir :)

  • @codingProfile449
    @codingProfile449 4 дня назад

    c++ tabulation code:
    // no of ways in which the boolean expression evaluates to 'true'
    // logical operators present are: &,|, ^
    int countWays(int n, string s) {
    // state: dp[i][j][0]: # ways the expresion from index i to j evaluates to 'false', similary dp[i][j][1]: # ways expr evaluates to 'true'
    vector dp(n, vector (n, vector (2, 0)));
    // bc: when i < j then ans = 0
    // when i == j: then if s[i] == 'true', dp[i][j][0] = 0, dp[i][j][1] = 1 and v.v
    // transition: since we're doing partition at logical operators bcz: then left side and right of the problem becomes an independent subproblem.
    // flow of states: bottom to top && left to right
    for(int i = n-1; i >= 0; i -= 2) {
    for(int j = 0; j < n; j += 2) {
    // transition for dp[i][j][0/1]
    // bc
    if(i > j) continue;
    if(i == j) {
    if(s[i] == 'T') dp[i][j][1] = 1, dp[i][j][0] = 0;
    else dp[i][j][0] = 1, dp[i][j][1] = 0;
    }
    else {
    int waysTrue = 0, waysFalse = 0; // total no of ways in which the exp evaluates to true or false.
    for(int ind = i+1; ind < n && ind

  • @harshdasila6680
    @harshdasila6680 2 года назад +1

    leetcode m nhi h kya ye?

  • @coding8000
    @coding8000 2 года назад +2

    Hi, striver , what if we watch your video, by applying US VPN, do it will increase your earning, if yes we will do it.?

    • @ssk191998
      @ssk191998 2 года назад

      doesn't work like that

  • @kothapalliavinashkumar8699
    @kothapalliavinashkumar8699 Год назад +1

    for and case lets assume left true ways = 10 and right true ways =5 how can it be left*right .we got true only when both r true. i.e.,min of those two.
    am i wrong .please explain

    • @aakashrockster8576
      @aakashrockster8576 Год назад +1

      ok, i will explain you using one exmaple, lets say we have 3 places delhi,hyderabad,chennai. Think delhi and chennai as start and end points while hyderabad is mid point. lets say we have only 2 ways to travel from delhi to hyderabad,(way1,way2) and simillarly we have 2 ways to travel to chennai from hyderabad(way3,way4). so what are the total ways to travel to chennai from delhi i,e., 4(way1->way3,way1->4,way2->way3,way2->way4) which is obtained by multiplying totalways(delhi to hyderabad) and totalways(hyderabad to chennai) which is supposed to be 2*2=4. I hope this explanation clear your doubt.

  • @YashAgarwal-l6z
    @YashAgarwal-l6z 4 дня назад

    The question linked to DP-52 in the A-Z sheet is wrong. Its of stack. Kindly fix it! Peace and love ❣

  • @kailashpatel231
    @kailashpatel231 Год назад +1

    we just need true wale ways ,why we aree adding false wale ways ,and returning both

  • @NikhilGupta-zo5jh
    @NikhilGupta-zo5jh 2 года назад +1

    Understood As Always.
    Below is the tabulation code.
    #include
    int mod= (int)(1e9)+7;
    long long f(int i, int j,int isTrue, string &exp, vector& dp){
    if(i==j){
    if(isTrue) return exp[i]=='T';
    return exp[i]=='F';
    }
    if(dp[i][j][isTrue]!=-1) return dp[i][j][isTrue];

    long long cnt=0;
    for(int k=i+1; k

  • @anupn5945
    @anupn5945 Год назад

    Whys we are doing ways+=

  • @SACHINMEENA-ls4en
    @SACHINMEENA-ls4en 11 месяцев назад +1

    CFBR

  • @aayush5474
    @aayush5474 2 года назад

    op

  • @divy04
    @divy04 2 месяца назад

    I tried solving without watching the video, my solution is accepted in gfg, but not in code studio

  • @aryansinha1818
    @aryansinha1818 Год назад

    Operand will be a operator, right?

  • @atulwadhwa192
    @atulwadhwa192 7 месяцев назад

    Gfg Tabulation (Approach 2):
    Here I'll be travesing i and j only towards operands i.e. T or F instead of traversing i and j over each index
    int countWays(int n, string s){
    // code here
    // vector dp(n,vector(n,vector(2,-1)));
    // return solve(0,n-1,true,s,dp)%modulo;
    vector dp(n,vector(n,vector(2,0)));
    for(int i=0;i=0;i-=2){
    for(int j=i+2;j

  • @tvwanderer7729
    @tvwanderer7729 4 месяца назад

    Understood but i do not think it will be asked in interviews.

  • @sanskargubreley8754
    @sanskargubreley8754 Год назад +1

    #Tabulation code in python
    def tabular(self,s):
    n = len(s)
    dp=[[[0 for i in range(2)] for j in range(n+1)] for k in range(n+1)]
    for i in range(n):
    for j in range(n):
    for flag in range(2):
    if i == j:
    if flag :
    dp[i][j][flag] = int(s[i]=='T')
    # print("t",dp[i][j][flag])
    else:
    dp[i][j][flag] = int(s[i]=='F')
    # print("f",dp[i][j][flag])

    for i in range(n-1,-1,-1):
    for j in range(n):
    if i>=j:
    continue
    else:
    for flag in range(2):
    ans = 0
    for ind in range(i+1,j,2):
    lt = dp[i][ind-1][1]
    lf = dp[i][ind-1][0]
    rt = dp[ind+1][j][1]
    rf = dp[ind+1][j][0]

    if s[ind] == '&':
    if flag:
    ans += lt*rt
    else:
    ans += lf*rf + rt*lf + lt*rf
    elif s[ind] == '|':
    if flag:
    ans += lt*rt + lt*rf + rt*lf
    else:
    ans += lf*rf
    else:
    if flag:
    ans+= lf*rt + rf*lt
    else:
    ans+=lf*rf + lt*rt
    dp[i][j][flag] = ans
    return dp[0][n-1][1]

  • @iamnoob7593
    @iamnoob7593 6 месяцев назад

    US striver , Diffucult one , No way i would have got this in interview

  • @addityasharma6426
    @addityasharma6426 2 года назад

    understood :-)

  • @sarveshsingh3657
    @sarveshsingh3657 Месяц назад

    I think striver also has to go through the solution to explain this kinda problems

  • @namanpadiyar09
    @namanpadiyar09 Месяц назад

    tough question

  • @adityakeshari2295
    @adityakeshari2295 2 года назад

    US

  • @amalsuresh5660
    @amalsuresh5660 2 года назад +1

    i am getting wrong answer in CodingNinja's platform ( 10/11 test cases passed) need help

    • @ssk191998
      @ssk191998 2 года назад

      same

    • @anktmshr
      @anktmshr Год назад

      Must be due to typecasting from Long back to int